/* ===================================
   SparzaFi Blog Styles
   Official Brand Colors - Dark Mode
   =================================== */

/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    /* Official SparzaFi Brand Colors */
    --primary-color: #6B00FF;           /* Bright Purple Accent */
    --primary-hover: #8533FF;           /* Lighter purple on hover */
    --secondary-color: #6B00FF;         /* Bright Purple */
    --accent-color: #6B00FF;            /* Bright Purple Accent */
    --bg-dark: #1A0028;                 /* Dark Purple Background */
    --bg-section: #000000;              /* Black Elements/Sections */
    --bg-card: #000000;                 /* Black Cards */
    --text-primary: #FFFFFF;            /* White Text */
    --text-secondary: #CCCCCC;          /* Light Gray Text */
    --text-muted: #999999;              /* Muted Gray Text */
    --border-color: #333333;            /* Dark Border */
    --success-color: #10B981;           /* Success Green */
    --error-color: #EF4444;             /* Error Red */
    --warning-color: #F59E0B;           /* Warning Orange */

    /* Additional Colors */
    --glow-purple: rgba(107, 0, 255, 0.3);  /* Soft Purple Glow */

    /* Spacing */
    --section-padding: 60px 0;
    --container-padding: 0 20px;
    --card-padding: 30px;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
    --font-size-body: 1rem;

    /* Effects */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --glow-primary: 0 0 20px var(--glow-purple);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===================================
   Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ===================================
   Container & Layout
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
}

/* ===================================
   Header / Navigation
   =================================== */
.header {
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
    transition: var(--transition);
}

.logo:hover .logo-img {
    filter: brightness(1.3) drop-shadow(0 0 10px var(--glow-purple));
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
    box-shadow: var(--glow-primary);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(107, 0, 255, 0.5);
    color: var(--text-primary);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #DC2626;
    color: white;
}

/* ===================================
   Cards
   =================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: var(--card-padding);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.post-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-section);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-card-category {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===================================
   Grid Layouts
   =================================== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ===================================
   Forms
   =================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--glow-purple);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===================================
   Dashboard
   =================================== */
.dashboard-header {
    background: var(--bg-section);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.post-item:hover {
    border-color: var(--primary-color);
}

.post-item-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.post-item-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-item-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===================================
   Category Filter
   =================================== */
.category-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-badge {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.category-badge:hover,
.category-badge.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===================================
   Blog Post Content
   =================================== */
.post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 3rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 2rem 0;
}

.post-content code {
    background: var(--bg-section);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
}

.post-content pre {
    background: var(--bg-section);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content ul,
.post-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* ===================================
   Alerts / Messages
   =================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-info {
    background: rgba(107, 0, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--bg-section);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
        --font-size-h3: 1.25rem;
        --section-padding: 40px 0;
    }

    .logo-img {
        height: 40px;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ===================================
   Loading Spinner
   =================================== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   Share Buttons
   =================================== */
.share-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
}

.share-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn svg {
    flex-shrink: 0;
}

.share-twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
    color: white;
}

.share-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: white;
}

.share-linkedin:hover {
    background: #0A66C2;
    border-color: #0A66C2;
    color: white;
}

.share-whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.share-copy:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.copy-notification {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.copy-notification.show {
    display: inline-block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   Comments Section
   =================================== */
.comment {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-time {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.comment-delete {
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.comment-delete:hover {
    background: var(--error-color);
    color: white;
}

.comment-body {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.comment-footer {
    display: flex;
    gap: 1rem;
}

.comment-like {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.comment-like:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.no-comments {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

#comment-form textarea {
    background: var(--bg-card);
    color: var(--text-primary);
}

#comment-form textarea:focus {
    outline: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

/* ===================================
   Authentication Modal
   =================================== */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.auth-modal-close:hover {
    color: var(--text-primary);
}

.auth-modal-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--glow-purple);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.auth-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

#google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

#google-signin-btn svg {
    width: 20px;
    height: 20px;
}
