@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #00d4aa;
    --warning: #feca57;
    --danger: #ff6b6b;
    
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: rgba(0,0,0,0.1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #b8c1ec;
    --text-muted: #8892b0;
    --border-color: rgba(255,255,255,0.1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Animated background */
.blog-bg-anim {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.blog-bg-anim .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .18;
    animation: blogBgAnim 18s infinite alternate;
}
.blog-bg-anim .shape-1 { width: 420px; height: 420px; background: #667eea; top: -120px; right: -80px; }
.blog-bg-anim .shape-2 { width: 320px; height: 320px; background: #10b981; bottom: -100px; left: -60px; animation-delay: -6s;}
.blog-bg-anim .shape-3 { width: 180px; height: 180px; background: #764ba2; top: 60%; left: 10%; animation-delay: -3s;}
.blog-bg-anim .shape-4 { width: 120px; height: 120px; background: #f59e0b; bottom: 20%; right: 18%; animation-delay: -8s;}
@keyframes blogBgAnim {
    0% { transform: scale(1) translateY(0);}
    100% { transform: scale(1.1) translateY(30px);}
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    transition: var(--transition);
    position: relative;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Animated Background - MORE MOVEMENT */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.2;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -15%;
    right: -15%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb, #667eea);
    bottom: -10%;
    left: -10%;
    animation-delay: 3s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #764ba2, #f093fb);
    top: 30%;
    left: 60%;
    animation-delay: 6s;
}

.shape-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #00d4aa, #667eea);
    top: 60%;
    right: 20%;
    animation-delay: 9s;
}

.shape-5 {
    width: 280px;
    height: 280px;
    background: linear-gradient(135deg, #feca57, #f093fb);
    bottom: 40%;
    left: 15%;
    animation-delay: 12s;
}

.shape-6 {
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, #764ba2, #00d4aa);
    top: 10%;
    left: 30%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(80px, 60px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(0, 120px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translate(-60px, 60px) rotate(270deg) scale(1.05);
    }
}

/* Floating Particles */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-150px) translateX(150px) rotate(360deg);
        opacity: 0;
    }
}

/* Header - COMPLETE REWRITE */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

[data-theme="dark"] .header {
    background: rgba(10, 14, 26, 0.95);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 20px;
}

.logo {
    font-size: clamp(1rem, 2.5vw, 1.3rem); /* FIX: کوچکتر برای سه خط */
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.3; /* FIX: فاصله بین خطوط */
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-icon {
    position: absolute;
    font-size: 20px;
    transition: var(--transition);
}

.theme-icon.sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-icon.moon {
    opacity: 0;
    transform: scale(0) rotate(180deg);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.header-login {
    padding: 10px 24px;
    border: 1.5px solid rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.header-login:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.menu-toggle.active span:nth-child(1){transform:translateY(8px) rotate(45deg);}
.menu-toggle.active span:nth-child(2){opacity:0;}
.menu-toggle.active span:nth-child(3){transform:translateY(-8px) rotate(-45deg);}

@media (max-width: 900px) {
    .header .container { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav { flex-direction: column; gap: 8px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 0; margin-top: 8px; width: 100%; display: none;}
    [data-theme="dark"] .nav { background: #232b3e; }
    .nav.active { display: flex; }
    .menu-toggle { display: block; }
    .nav-actions { width: 100%; justify-content: flex-end; }
}

/* Main container */
.blog-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 16px 60px 16px;
    position: relative;
    z-index: 2;
}

/* Blog list grid */
.blog-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}
@media (max-width: 700px) {
    .blog-list { grid-template-columns: 1fr; }
}

/* Blog card */
.blog-card {
    background: var(--blog-card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .25s, transform .2s;
    display: flex;
    flex-direction: column;
    min-height: 340px;
    border: 1px solid var(--panel-border);
}
[data-theme="dark"] .blog-card { background: var(--blog-card-dark); border-color: #2d3750; }
.blog-card:hover { box-shadow: 0 16px 48px -16px #667eea44; transform: translateY(-4px);}
.blog-card .cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e5e7eb;
}
.blog-card .card-body {
    padding: 22px 20px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.blog-card .blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #22223b;
}
[data-theme="dark"] .blog-card .blog-title { color: #e2e8f0; }
.blog-card .blog-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 12px;
}
.blog-card .blog-date {
    color: #8fa1bf;
    font-size: 13px;
    margin-top: auto;
    font-family: 'Vazirmatn', sans-serif;
}
.blog-card .blog-link {
    margin-top: 18px;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}
.blog-card .blog-link:hover { color: #764ba2; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}
.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #d9e1ee;
}
.empty-state p {
    font-size: 16px;
    margin-bottom: 25px;
    color:#9aaac2;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px;
    margin-top: 80px;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col p,
.footer-col a {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}
/* Scrollbar */
::-webkit-scrollbar {width:10px;}
::-webkit-scrollbar-track {background:#f7f8fa;}
::-webkit-scrollbar-thumb {background:#e5e7eb;border-radius:6px;}
[data-theme="dark"] ::-webkit-scrollbar-track {background:#232b3e;}
[data-theme="dark"] ::-webkit-scrollbar-thumb {background:#2d3750;}
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    /* FIX: Mobile header layout - همبرگر چپ، تم وسط، لوگو راست */
    .header .container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 16px;
        padding-bottom: 16px;
    }
    
    /* Hamburger: LEFT (order 1) */
    .menu-toggle {
        order: 3;
        margin: 0;
    }
    
    /* Theme toggle: CENTER (order 2) */
    .nav-actions {
        order: 2;
        margin: 0 auto 0 12px;
        gap: 12px;
    }
    
    /* Logo: RIGHT (order 3) */
    .logo {
        order: 1;
        margin: 0;
        font-size: 0.9rem;
        line-height: 1.2;
        text-align: right;
    }
    
    /* SHOW login button on mobile (unlike Landing) */
    .header-login {
        display: inline-block;
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Navigation menu - بکگراند با تم یکسان */
    .nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
        z-index: 998;
        box-shadow: var(--shadow-lg);
    }

    .nav.active {
        max-height: 400px;
        opacity: 1;
        padding: 16px;
    }

    .nav-link {
        padding: 16px 20px;
        width: 100%;
        display: block;
        border-radius: 12px;
        transition: background 0.3s ease;
        text-align: right;
        font-size: 16px;
        background: transparent;
        color: var(--text-primary);
    }
    
    .nav-link:hover {
        background: rgba(102, 126, 234, 0.1);
        color: var(--text-primary);
    }

    .nav-link::before {
        display: none;
    }
    }