/* --- General & Variables --- */
:root {
    --dark-grey: #101010;
    --medium-grey: #1a1a1a;
    --light-grey: #f5f5f5;
    --golden: #D4AF37;
    --golden-hover: #FADB5F;
    --font-primary: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--dark-grey);
    color: var(--light-grey);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

/* --- Preloader, Cursor (Unchanged) --- */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--dark-grey); z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.preloader-logo { font-family: var(--font-primary); font-weight: 300; font-size: 3rem; color: var(--golden); animation: pulse 1.5s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } }
.cursor-dot, .cursor-outline { position: fixed; top: 0; left: 0; transform: translate(-50%, -50%); border-radius: 50%; z-index: 9000; pointer-events: none; }
.cursor-dot { width: 8px; height: 8px; background-color: var(--golden); transition: transform 0.1s; }
.cursor-outline { width: 40px; height: 40px; border: 2px solid var(--golden); transition: transform 0.2s, width 0.3s, height 0.3s, opacity 0.3s; }
.cursor-outline.hovered { transform: scale(1.5); opacity: 0.5; }

/* --- General Content & Typography --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
h1, h2, h3, h4 { font-family: var(--font-primary); color: white; font-weight: 300; }
h2 { font-size: 3rem; text-align: center; margin-bottom: 4rem; position: relative; }
h2::after { content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); width: 70px; height: 2px; background-color: var(--golden); }
h3, h4 { font-weight: 400; letter-spacing: 1px; }
h4 { font-size: 1.1rem; }
section, footer { padding: 6rem 0; position: relative; }
a, button { cursor: none; }
a { color: var(--golden); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--golden-hover); }

.btn {
    display: inline-block;
    padding: 14px 35px;
    background: transparent;
    color: var(--golden);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid var(--golden);
    transition: all 0.4s ease;
    text-align: center;
}
.btn:hover { background: var(--golden); color: var(--dark-grey); }

.btn-secondary {
    color: #aaa;
    border-color: #555;
}
.btn-secondary:hover {
    background: #555;
    color: var(--light-grey);
    border-color: #555;
}

/* --- Header --- */
#main-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: 1.5rem 0; transition: background-color 0.4s ease, padding 0.4s ease; }
#main-header.scrolled { background-color: rgba(16, 16, 16, 0.8); backdrop-filter: blur(10px); padding: 1rem 0; }
.header-aligner {
    width: 55%;
    padding: 0 8%;
    display: flex;
    align-items: center;
}
.logo { font-weight: 400; font-size: 1.8rem; color: white; margin-right: auto; }
#main-header nav { display: flex; align-items: center; } 
#main-header nav a { color: white; margin: 0 1.5rem; font-weight: 300; position: relative; padding-bottom: 5px; letter-spacing: 1px; }
#main-header nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background-color: var(--golden); transition: width 0.4s ease; }
#main-header nav a:hover::after { width: 100%; }

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
    display: none;
    z-index: 1001;
}


/* --- Hero Section --- */
#hero {
    padding: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Added to contain pseudo-element */
}
.hero-container { display: flex; width: 100%; height: 100%; }
.hero-text-content {
    width: 55%;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8%;
    position: relative; /* Ensure text is above the pseudo-element */
    z-index: 2;
}
.hero-image-container { 
    width: 45%; 
    height: 100%; 
    overflow: hidden;
    position: relative; /* Ensure image is above the pseudo-element */
    z-index: 2;
}
.hero-image { width: 100%; height: 100%; background-size: cover; background-position: center; filter: grayscale(0.8) contrast(1.1); transition: transform 1s ease, filter 0.5s ease; }
.hero-image-container:hover .hero-image { transform: scale(1.05); filter: grayscale(0.2) contrast(1); }

#hero h1 {
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: white;
    opacity: 0;
    animation: fadeInLeft 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) 0.9s forwards;
}
#hero p {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--golden);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInLeft 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) 1.1s forwards;
}
.hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-self: flex-start;
    opacity: 0;
    animation: fadeInLeft 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) 1.3s forwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Down Indicator */
.scroll-down {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.scroll-down .mouse {
    width: 28px;
    height: 50px;
    border: 2px solid #fff;
    border-radius: 14px;
    position: relative;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.scroll-down:hover .mouse {
    opacity: 1;
}
.scroll-down .mouse span {
    display: block;
    width: 4px;
    height: 10px;
    background-color: #fff;
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-anim 2s infinite ease-out;
}
@keyframes scroll-anim {
    0% {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }
    100% {
        transform: translateY(15px) translateX(-50%);
        opacity: 0;
    }
}

/* --- Summary Section --- */
#summary {
    background-color: transparent;
}
.summary-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
    align-items: center;
}
#summary h2 {
    text-align: left;
    margin-bottom: 2rem;
}
#summary h2::after {
    left: 0;
    transform: translateX(0);
}
.summary-text p {
    font-weight: 300;
    line-height: 1.8;
    color: #ccc;
}
.summary-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.highlight-card {
    background-color: var(--dark-grey);
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--golden);
    transition: all 0.3s ease-in-out;
}
.highlight-card:hover {
    transform: translateY(-5px);
    background-color: #2a2a2a;
}
.highlight-card h3 {
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--golden);
    line-height: 1.2;
}
.highlight-card p {
    font-size: 1rem;
    color: #ddd;
    font-weight: 300;
}


/* --- Experience Section (Timeline) --- */
#experience {
    overflow: hidden; /* Added to contain pseudo-element */
}
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::after { content: ''; position: absolute; width: 2px; background-color: #444; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 1; }
.timeline-item { padding: 10px 40px; position: relative; width: 50%; opacity: 0; transform: translateY(50px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; z-index: 2; }
.timeline-item.visible { opacity: 1; transform: translateY(0); }
.timeline-item:nth-child(odd) { left: 0; text-align: left; padding-left: 0; padding-right: 60px; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; padding-left: 60px; padding-right: 0; }

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--golden);
    top: 25px;
    z-index: 1;
    transform: rotate(45deg);
}
.timeline-item:nth-child(odd)::after { right: -8px; }
.timeline-item:nth-child(even)::after { left: -8px; }

.timeline-content { padding: 25px 30px; background-color: var(--medium-grey); position: relative; transition: border-color 0.4s ease; border: 1px solid #333; }
.timeline-item:hover .timeline-content { border-color: var(--golden); }

.timeline-content h3 {
    font-size: 1.3rem;
    color: var(--golden);
}
.timeline-company {
    font-weight: 300;
    display: block;
    margin-bottom: 0.25rem;
}
.timeline-date {
    font-weight: 300;
    display: block;
}
.timeline-content ul {
    list-style-position: inside;
    padding-left: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
}
.timeline-content ul li {
    margin-bottom: 0.5rem;
}
.timeline-content ul li:last-child {
    margin-bottom: 0;
}

.timeline-break {
    text-align: center;
    position: relative;
    padding: 3rem 0;
    color: #888;
    z-index: 2;
}
.timeline-break h4 {
    color: #888;
    background-color: var(--dark-grey);
    display: inline-block;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* --- Skills Section --- */
#skills { background-color: transparent; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.skill-card { background-color: transparent; border: 1px solid #444; padding: 2.5rem 2rem; text-align: center; transition: all 0.4s ease; opacity: 0; transform: translateY(50px); font-weight: 300; }
.skill-card.visible { opacity: 1; transform: translateY(0); }
.skill-card:hover { transform: translateY(-10px); border-color: var(--golden); color: var(--golden); }

/* --- Education Section --- */
#education {
    overflow: hidden; /* Added to contain pseudo-element */
}
.education-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.education-column-title {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--golden);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #444;
}

.education-item {
    display: flex;
    align-items: flex-start;
    text-align: left;
    transition: transform 0.3s;
}

.education-item:not(:last-child) {
    margin-bottom: 2rem;
}

.education-item:hover {
    transform: translateX(5px);
}

.education-icon-wrapper {
    flex-shrink: 0;
    margin-right: 1.5rem;
    width: 44px;
}

.education-icon {
    width: 44px;
    height: 44px;
    color: var(--golden);
    position: relative;
}

.icon-bachelor::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -2px;
    width: 48px;
    height: 2px;
    background-color: currentColor;
}
.icon-bachelor::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 7px;
    width: 30px;
    height: 20px;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 3px 3px;
}

.icon-certificate {
    width: 38px;
    height: 28px;
    border: 2px solid currentColor;
    border-radius: 3px;
    margin-top: 4px;
}

.icon-certificate::before {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.icon-certificate::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 5px;
    width: 26px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 7px 0 currentColor;
}

.education-text h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    color: #f0f0f0;
}
.education-text p {
    color: #aaa;
    line-height: 1.5;
}

/* --- CTA Section --- */
#cta { background-attachment: fixed; text-align: center; background-color: transparent; }
#cta .container { max-width: 700px; }
#cta h2 { color: white; }
#cta p { margin: 0 auto 2rem; font-size: 1.1rem; }

/* --- Contact & Footer Section --- */
#contact { 
    background-color: transparent; 
    overflow: hidden; /* Added to contain pseudo-element */
}
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4rem; align-items: flex-start; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: #aaa; font-size: 0.9rem; font-weight: 300; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; background: var(--medium-grey); border: 1px solid #444; color: white; font-size: 1rem; font-family: var(--font-primary); transition: border-color 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--golden); }
#form-status { margin-top: 1rem; text-align: left; font-weight: 300; height: 20px;}

.contact-info {
    padding-top: 1.4rem;
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.contact-info p {
    margin-bottom: 2.5rem;
    color: #ccc;
    line-height: 1.8;
}

.contact-info ul {
    list-style: none;
    padding-left: 0;
}
.contact-info li {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}
.contact-info li:hover {
    transform: translateX(5px);
}
.contact-info li:last-child {
    margin-bottom: 0;
}
.contact-info li i {
    font-size: 1.2rem;
    color: var(--golden);
    margin-right: 1.5rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.footer-bottom { text-align: center; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid #333; font-size: 0.9rem; color: #888; }

/* --- Responsive Design --- */
@media(max-width: 992px) {
    #hero {
        padding-top: 8rem;
    }

    #hero .hero-container { flex-direction: column; }
    
    #hero .hero-text-content, #hero .hero-image-container {
        width: 100%;
        height: auto;
    }

    #hero .hero-text-content {
        flex-shrink: 0;
        text-align: center;
        padding: 0 10% 3rem 10%;
        justify-content: center;
        align-items: center;
        background: transparent; /* Make transparent on mobile for full bg visibility */
    }

    #hero .hero-image-container {
        flex-grow: 1;
        min-height: 200px;
    }

    #hero .hero-buttons {
        display: flex;
        flex-wrap: wrap;
        align-self: center;
        justify-content: center;
        width: 100%;
    }
    #hero .hero-buttons > .btn {
        flex: 1;
        min-width: 180px;
    }

    .header-aligner { width: 100%; padding: 0 10%; }
    #hero h1 { font-size: 3rem; }
    .cursor-dot, .cursor-outline { display: none; }
    body { cursor: auto; }
    .summary-grid { grid-template-columns: 1fr; }
    #summary h2 { text-align: center; }
    #summary h2::after { left: 50%; transform: translateX(-50%); }
    .education-layout { grid-template-columns: 1fr; }
}

@media(max-width: 768px) {
    /* Mobile Header & Nav */
    .header-aligner {
        width: 100%;
        padding: 0 5%;
        justify-content: space-between;
    }
    .logo {
        margin-right: 0;
    }

    #main-header nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: min(75vw, 350px);
        height: 100vh;
        background: var(--medium-grey);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }
    #main-header nav a {
        margin: 0;
        font-size: 1.2rem;
    }
    #main-header.nav-active nav {
        display: flex;
        transform: translateX(0);
    }

    /* Hamburger Toggle Button */
    .mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 2rem;
        height: 2rem;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    .mobile-nav-toggle span {
        width: 2rem;
        height: 2px;
        background: var(--light-grey);
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
        transform-origin: 1px;
    }
    
    #main-header.nav-active .mobile-nav-toggle span:nth-child(1) {
        transform: rotate(45deg);
    }
    #main-header.nav-active .mobile-nav-toggle span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    #main-header.nav-active .mobile-nav-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }
    
    h2 { font-size: 2.4rem; }

    .timeline::after,
    .timeline-item::after {
        display: none;
    }

    .timeline-item,
    .timeline-item:nth-child(odd), 
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 0;
        margin-bottom: 2rem;
    }

    .timeline-break {
        padding-top: 1rem;
        padding-bottom: 3rem;
    }

    .contact-grid { grid-template-columns: 1fr; gap: 5rem; }
}

@media(max-width: 480px) {
    #hero h1 {
        font-size: 2.5rem;
        line-height: 1.3;
    }
    #hero p {
        font-size: 0.9rem;
    }
}

/* --- Language Switcher (Minimalist) --- */
.language-switcher {
    position: relative;
    margin-left: 1.5rem; 
}

.lang-button {
    display: flex;
    align-items: center;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 6px;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.lang-button:hover {
    border-color: #444;
    background-color: var(--medium-grey);
}

.lang-button .flag-icon {
    font-size: 1.1rem;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.lang-button i.fa-chevron-down {
    color: #888;
    margin-left: 0.6rem;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.language-switcher.open .lang-button i.fa-chevron-down {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background-color: #202020;
    border: 1px solid #444;
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    z-index: 1001;
    display: none;
    min-width: 160px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.language-switcher.open .lang-dropdown {
    display: block;
}

.lang-dropdown li a.lang-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.35rem 1rem;
    text-decoration: none;
    color: #ccc;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 1rem;
    font-weight: 400;
    white-space: nowrap;
    margin: 0 !important;
}

.lang-dropdown li a.lang-option::after {
    display: none;
}

.lang-dropdown li a.lang-option:hover {
    background-color: var(--golden);
    color: var(--dark-grey);
}

.lang-option .flag-icon-squared {
    font-size: 1.2rem;
    box-shadow: 0 0 2px rgba(0,0,0,0.4);
}

@media(max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 1.5rem;
    }
    .lang-dropdown {
        right: 50%;
        transform: translateX(50%);
    }
}

/* Apply Vazirmatn font to the Persian language option */
.lang-dropdown .lang-fa {
    font-family: 'Vazirmatn', sans-serif;
}


/* --- ADDED CODE FOR DIFFERENT TRANSPARENT BACKGROUNDS --- */

/* 1. Shared styles for the background layer on all sections */
#hero::before,
#experience::before,
#education::before,
#contact::before,
#summary::before,
#skills::before,
#cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* تنظیمات مشترک تصویر */
    background-size: cover;      /* پوشاندن کل فضا */
    background-position: center; /* تصویر در مرکز */
    background-repeat: no-repeat;/* عدم تکرار تصویر */
    
    opacity: 0.2; /* شفافیت ۲۰ درصدی */
    z-index: -1;   /* قرار گرفتن در لایه پشتی */
}

/* 2. Specific background image for each section */
/* نام فایل تصویر مورد نظر خود را جایگزین کنید */

#hero::before {
    background-image: url('hero-background.jpg');
}

#summary::before {
    background-image: url('summary-background.jpg');
}

#experience::before {
    background-image: url('experience-background.jpg');
}

#skills::before {
    background-image: url('summary-background.jpg');
}

#education::before {
    background-image: url('education-background.jpg');
}

#cta::before {
    background-image: url('summary-background.jpg');
}

#contact::before {
    background-image: url('contact-background.jpg');
}

/* --- ADDED CODE FOR EQUAL SECTION HEIGHTS (DESKTOP) --- */
@media(min-width: 993px) {
    #summary,
    #skills,
    #cta {
        /* یک ارتفاع حداقلی برای هر سه سکشن تعریف می‌کنیم */
        /* این مقدار را می‌توانید به دلخواه تغییر دهید */
        min-height: 80vh;
    }

    #cta {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* --- ADDED CODE TO DISABLE PERSIAN LANGUAGE OPTION --- */
/* برای فعال‌سازی مجدد، این بلاک کد را حذف کنید یا کامنت کنید */

.lang-option.lang-fa {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}