:root {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --dark: #0f172a;
    --darker: #07103a;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --success: #10b981;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-light: rgba(255, 255, 255, 0.12);
    --card-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, #1e1b4b 100%);
    color: var(--light);
    line-height: 1.7;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

header.scrolled {
    padding: 0.8rem 2rem;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.8rem;
    padding: 0;
    /* مطمئن شوید که padding پیش‌فرضی ندارد */
    margin: 0;
    /* مطمئن شوید که margin پیش‌فرضی ندارد */
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

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

.nav-links a:hover::after {
    width: 100%;
}

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

.nav-links a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--light);
    font-family: inherit;
    font-size: 0.9rem;
}

.lang-btn.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero h1 .gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray-light);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.9rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.hero-image {
    position: relative;
    width: 420px;
    height: 420px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 0 8px rgba(124, 58, 237, 0.2),
        inset 0 0 0 16px rgba(6, 182, 212, 0.1);
    animation: morph 12s ease-in-out infinite;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }

    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }

    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

.hero-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100" opacity="0.05"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="white"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.hero-image-content {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Sections */
section {
    padding: 6rem 10%;
}

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

.section-badge {
    display: inline-block;
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-light);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-subtitle {
    color: var(--gray-light);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--gray-light);
}

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

.stat {
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(124, 58, 237, 0.3);
}

.stat i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(124, 58, 237, 0.3);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--primary);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    position: relative;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: rgba(124, 58, 237, 0.3);
}

.project-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--gray-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tag {
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-light);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary-light);
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(10px);
    border-color: rgba(124, 58, 237, 0.3);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.contact-text h3 {
    margin-bottom: 0.3rem;
}

.contact-text p {
    color: var(--gray-light);
}

.contact-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-family: 'Vazirmatn', sans-serif;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

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

/* Footer */
footer {
    background: rgba(7, 16, 58, 0.8);
    padding: 3rem 10%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: translateY(-5px);
}

.copyright {
    color: var(--gray-light);
    margin-top: 1rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
    }

    .hero-content {
        margin-bottom: 3rem;
    }

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

    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }


    .mobile-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 4rem 5%;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .hero-image {
        width: 300px;
        height: 300px;
    }
}

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

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

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

    .skills-container {
        grid-template-columns: 1fr;
    }

    .hero-image {
        width: 250px;
        height: 250px;
    }
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

/* تنظیم ابعاد تصویر لوگو */
.main-logo-img {
    height: 40px;
    /* تنظیم ارتفاع دلخواه */
    width: auto;
    transition: var(--transition);
}

header.scrolled .main-logo-img {
    height: 35px;
    /* کمی کوچک‌تر شدن در هنگام اسکرول */
}

/* از خط ۷۹ در CSS */
.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    /* این فاصله بین لوگوی جدید و متن 'معین زنجیریان' است */
}

/* تغییر (اختیاری): اگر می‌خواهید متنتان با لوگوی جدید هم‌تراز باشد */
.logo-text {
    /* ... کدهای قبلی ... */
    font-size: 1.5rem;
    font-weight: 800;
    /* ... کدهای قبلی ... */
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    /* مطمئن شوید که روی بقیه عناصر قرار می‌گیرد */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--dark);
    color: var(--light);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 600px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    border-right: 4px solid var(--primary);
    /* خط کناری برای زیبایی */
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-right-color: var(--success);
}

.toast-icon {
    font-size: 1.2rem;
}

/* About Section - Image Container */
.about-image {
    position: relative;
    width: 100%;
    height: 400px;
    /* ارتفاع ثابت برای کادر */
    border-radius: var(--card-radius);
    /* گردی گوشه‌ها */
    overflow: hidden;

    /* افکت شیشه‌ای/گرادیانت محیطی */
    background: var(--glass);
    /* پس‌زمینه شفاف */
    border: 1px solid var(--glass-light);
    /* خط کناری روشن */
    backdrop-filter: blur(15px);
    /* بلور پس‌زمینه (Glassmorphism) */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* سایه عمیق */

    /* یک حاشیه گرادیانت داخلی برای زیبایی بیشتر */
    padding: 10px;
    /* فضای بین کادر شیشه‌ای و عکس */
}

/* استایل تصویر داخل کادر */
.about-me-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    /* حفظ نسبت ابعاد و پوشش کامل کادر */
    border-radius: calc(var(--card-radius) - 5px);
    /* گردی کمتر برای عکس داخلی */
    transition: transform 0.5s ease;
}

/* افکت هاور (اختیاری) */
.about-image:hover .about-me-photo {
    transform: scale(1.03);
    /* کمی بزرگ شدن هنگام هاور */
}
.hero-image-content {
    /* تعریف ابعاد کادر والد (div) */
    width: 300px;
    height: 300px; 
    /* این ویژگی برای اطمینان از عدم خروج محتوا ضروری است */
    overflow: hidden; 
}

.my-image {
    /* تصویر را به اندازه کامل کادر والد تنظیم می‌کند */
    width: 100%;
    height: 100%;
    /* تضمین می‌کند که عکس تمام کادر را پوشش دهد و بریده شود اما کشیده نشود */
    object-fit: cover; 
}
