/* ========== Font Face ========== */
@font-face {
    font-family: 'YekanBakh';
    src: url('assets/font/YekanBakh-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('assets/font/YekanBakh-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YekanBakh';
    src: url('assets/font/YekanBakh-ExtraBlack.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ========== CSS Variables ========== */
:root {
    /* Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    /* Brand Colors */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #06b6d4;
    --success: #10b981;
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
}

body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'YekanBakh', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========== Theme Toggle ========== */
.theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.4);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

body.dark-mode .theme-toggle .sun-icon {
    display: none;
}

body.dark-mode .theme-toggle .moon-icon {
    display: block;
}

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    padding: 1rem 0;
    z-index: 999;
    transition: all 0.3s ease;
    height: 70px; /* ارتفاع ثابت */
    display: flex;
    align-items: center;
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.8);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

.navbar.scrolled {
    padding: 0.6rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Container - شامل لوگو و منو */
.navbar-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center; /* این باعث میشه همه چیز وسط قرار بگیره */
    justify-content: space-between;
    position: relative;
    height: 100%;
}

/* Logo - سمت راست */
.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
    position: absolute;
    right: 2rem;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

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

body.dark-mode .logo-image {
    content: url('assets/images/logo-light.png');
}

/* Menu - وسط */
.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    transform: translate(-50%, -50%); /* هم افقی هم عمودی وسط */
}

.navbar-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.navbar-link:hover {
    color: var(--primary-light);
    background: rgba(59, 130, 246, 0.1);
}

.navbar-link.active {
    color: var(--primary-light);
    background: rgba(59, 130, 246, 0.15);
}

/* Hamburger Menu (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
}

.hamburger span {
    width: 26px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ========== Navbar Responsive ========== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        position: absolute;
        right: 1.5rem; /* همبرگر کاملاً سمت راست */
        top: 50%;
        transform: translateY(-50%);
    }

    .navbar-container {
        justify-content: center;
        position: relative;
    }

    /* Logo - Mobile: کاملاً وسط */
    .navbar-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        margin: 0;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%; /* شروع از خارج سمت راست */
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        left: auto;
        transform: none;
    }

    body.dark-mode .navbar-menu {
        background: var(--bg-secondary);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .navbar-menu.active {
        right: 0; /* باز شدن از سمت راست */
    }

    .navbar-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-link {
        display: block;
        width: 100%;
        padding: 1.2rem 1rem;
        border-radius: 0;
        font-size: 1.1rem;
    }

    .logo-image {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 30px;
    }

    .navbar-menu {
        width: 100%;
    }

    .hamburger {
        right: 1rem;
    }
}
/* ========== Hero Section ========== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    color: white;
    position: relative;
    overflow: hidden;
    padding: 2rem;
    margin-top: 70px;
}

.hero-decoration {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(30, 64, 175, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeInDown 1s ease 0.2s backwards;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-title .highlight {
    background: linear-gradient(90deg, #fff, #e0f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease 0.6s backwards;
}

.hero-description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    animation: fadeInUp 1s ease 0.8s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 1s backwards;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

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

/* ========== Container ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== Section ========== */
.section {
    padding: 6rem 0;
    background: var(--bg-primary);
    transition: background 0.3s ease;
}

.section-dark {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

/* ========== Services Grid ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-card:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.service-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.service-features {
    list-style: none;
}

.service-features li {
    color: var(--text-secondary);
    padding: 0.4rem 0;
    padding-right: 1.5rem;
    position: relative;
    font-size: 0.95rem;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--primary-light);
    font-weight: bold;
}

/* ========== Skills Section ========== */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
}

.skill-category-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.skill-tag {
    background: var(--bg-card);
    border: 2px solid var(--primary-light);
    color: var(--text-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ========== Portfolio Grid ========== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.portfolio-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.portfolio-image {
    background: var(--gradient-primary);
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-placeholder {
    font-size: 4rem;
}

.portfolio-content {
    padding: 1.8rem;
}

.portfolio-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
}

.portfolio-content p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portfolio-tags span {
    background: var(--bg-secondary);
    color: var(--primary);
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

body.dark-mode .portfolio-tags span {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
}

/* ========== About Section ========== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.3rem;
    font-size: 1.05rem;
}

.about-text strong {
    color: var(--primary);
}

body.dark-mode .about-text strong {
    color: var(--primary-light);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    text-align: center;
}

.stat-item {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 1rem;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ========== Contact Section ========== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.3rem 1.5rem;
    transition: all 0.3s ease;
}

.contact-item:hover {
    border-color: var(--primary-light);
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-details h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.contact-details a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: var(--primary-light);
}

.contact-cta {
    background: var(--gradient-hero);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.contact-cta h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.contact-cta p {
    opacity: 0.9;
    margin-bottom: 2rem;
}

.contact-cta .btn-primary {
    background: white;
    color: var(--primary);
}

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

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

.footer-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Hero Avatar ========== */
.hero-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease;
}

.avatar-image:hover {
    transform: scale(1.05);
}

.avatar-decoration {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(30, 64, 175, 0.4));
    filter: blur(20px);
    z-index: 1;
    animation: pulse 3s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ========== Footer Logo ========== */
.footer-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

body.dark-mode .footer-logo {
    content: url('assets/images/logo-light.png');
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

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

    .container {
        padding: 0 1.2rem;
    }

    .section {
        padding: 4rem 0;
    }

    .theme-toggle {
        top: 1rem;
        left: 1rem;
        width: 48px;
        height: 48px;
    }

    .hero-avatar {
        width: 140px;
        height: 140px;
        margin-bottom: 1.5rem;
    }

    .footer-logo {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero-avatar {
        width: 120px;
        height: 120px;
    }

    .footer-logo {
        max-width: 120px;
    }
}

/* ========== Accessibility ========== */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
