/* ========== تنظیمات پایه و فونت ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #B74BED;
    --primary-dark: #9b3bcc;
    --primary-light: #d48aff;
}

body {
    font-family: 'IRANSans_Fa', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #12102a 100%);
    color: #eef4ff;
    line-height: 1.6;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(18, 18, 40, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    border: 1px solid rgba(183, 75, 237, 0.2);
    transition: background 0.3s ease;
}

/* ========== کنترل بار (زبان + تم) ========== */
.control-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* دکمه‌های زبان */
.language-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary-light);
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: 0.3s;
    font-size: 0.9rem;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

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

/* ========== سوئیچ دارک/لایت ========== */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-label {
    font-size: 0.85rem;
    color: var(--primary-light);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1e1e3a;
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid var(--primary);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.slider i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    z-index: 1;
}

.slider .fa-sun {
    left: 8px;
    color: var(--primary);
}

.slider .fa-moon {
    right: 8px;
    color: var(--primary);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* ========== زبان انگلیسی و اعداد ========== */
html[lang="en"] body,
html[lang="en"] * {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.lang-en {
    font-family: 'IRANSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.lang-fa {
    font-family: 'IRANSans_Fa', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* ========== هدر ========== */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-img img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: 0 10px 30px rgba(183, 75, 237, 0.3);
}

h1 {
    font-size: 2.2rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    color: var(--primary-light);
    font-size: 1.2rem;
    font-weight: 500;
}

.contact-info-header, .personal-detail {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0.8rem 0;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.contact-info-header i, .personal-detail i {
    color: var(--primary);
    margin-left: 5px;
}

/* ========== شبکه‌های اجتماعی ========== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.2rem 0;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(183, 75, 237, 0.15);
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.4rem;
    transition: 0.3s;
    text-decoration: none;
}

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

/* ========== دکمه دانلود ========== */
.download-resume {
    text-align: center;
    margin: 1rem 0 2rem;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 12px 30px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    box-shadow: 0 5px 15px rgba(183, 75, 237, 0.3);
    display: inline-block;
}

.btn-download:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(183, 75, 237, 0.5);
}

/* ========== بخش‌ها ========== */
section {
    background: rgba(30, 30, 55, 0.5);
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: 0.2s;
    border: 1px solid rgba(183, 75, 237, 0.1);
}

section:hover {
    background: rgba(30, 30, 55, 0.7);
    border-color: rgba(183, 75, 237, 0.3);
}

h2 {
    font-size: 1.8rem;
    border-right: 5px solid var(--primary);
    padding-right: 15px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: var(--primary);
}

/* ========== درباره من ========== */
.about p {
    text-align: justify;
    line-height: 1.8;
}

/* ========== مهارت‌ها ========== */
.skill-bars .skill {
    margin-bottom: 1rem;
}

.skill span {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.bar {
    background: #1e1e3a;
    border-radius: 20px;
    overflow: hidden;
    height: 14px;
}

.fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    height: 100%;
    width: 0;
    border-radius: 20px;
    transition: width 2s ease-out;
}

/* ========== خدمات (دو ستونی) ========== */
.expertise-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.expert-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 20px;
    transition: 0.3s;
    border: 1px solid rgba(183, 75, 237, 0.2);
}

.expert-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(183, 75, 237, 0.2);
    background: rgba(183, 75, 237, 0.1);
}

.expert-icon i {
    font-size: 2.5rem;
    color: var(--primary);
}

.expert-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.expert-content p {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* ========== دکمه‌های همکاری ========== */
.btn-cooperation-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-expertise {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 14px 32px;
    border-radius: 40px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1rem;
}

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

.btn-secondary:hover {
    background: rgba(183, 75, 237, 0.1);
    transform: translateY(-3px);
}

/* ========== فرم تماس ========== */
.contact input, .contact textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
}

.contact input:focus, .contact textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(183, 75, 237, 0.3);
}

.contact button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.contact button:hover {
    transform: scale(0.98);
}

#formStatusFa, #formStatusEn {
    margin-top: 15px;
    text-align: center;
}

/* ========== سوابق کاری (دو ستونی) ========== */
.experience .jobs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.job {
    margin-bottom: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
    height: 100%;
}

.job h3, .edu-item h3 {
    font-size: 1.1rem;
    color: var(--primary-light);
}

.date {
    font-size: 0.85rem;
    color: var(--primary);
    display: inline-block;
    margin: 5px 0;
}

/* ========== تحصیلات ========== */
.edu-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
}

/* ========== پروژه‌ها ========== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.port-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s;
}

.port-item a {
    text-decoration: none;
    display: block;
}

.port-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    width: 100%;
    text-align: center;
    padding: 10px;
    transform: translateY(100%);
    transition: 0.3s;
    font-weight: bold;
    color: white;
}

.port-item:hover .overlay {
    transform: translateY(0);
}
.port-item:hover {
    transform: scale(1.02);
}

/* ========== دوره‌ها ========== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.course-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 16px;
    transition: 0.2s;
}

.course-card i {
    font-size: 2rem;
    color: var(--primary);
}

.course-card h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.course-card p {
    font-size: 0.85rem;
    color: #a0aec0;
}

/* ========== فوتر ========== */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    color: #64748b;
}

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

.footer-site {
    margin-top: 10px;
}

/* ==================== تم لایت (روشن) - ملایم ==================== */
body.light-mode {
    background: linear-gradient(135deg, #d1d1e0 0%, #b8b8cc 100%);
    color: #1a1a2e;
}

body.light-mode .container {
    background: rgba(245, 245, 255, 0.95);
    border: 1px solid rgba(183, 75, 237, 0.3);
}

body.light-mode section {
    background: rgba(235, 235, 250, 0.85);
    border-color: rgba(183, 75, 237, 0.2);
}

body.light-mode .contact-info-header,
body.light-mode .personal-detail {
    color: #2d3748;
}

body.light-mode .job h3,
body.light-mode .edu-item h3 {
    color: var(--primary-dark);
}

body.light-mode .expert-card {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(183, 75, 237, 0.15);
}

body.light-mode .expert-card:hover {
    background: rgba(183, 75, 237, 0.08);
    border-color: var(--primary);
}

body.light-mode .expert-content h3 {
    color: #2d3748;
}

body.light-mode .expert-content p {
    color: #64748b;
}

body.light-mode .skill-bars .bar {
    background: #cbd5e1;
}

body.light-mode .skill span {
    color: #2d3748;
}

body.light-mode .course-card {
    background: rgba(0, 0, 0, 0.04);
}

body.light-mode .course-card h3 {
    color: #2d3748;
}

body.light-mode .course-card p {
    color: #64748b;
}

body.light-mode .contact input,
body.light-mode .contact textarea {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1a1a2e;
}

body.light-mode .contact input::placeholder,
body.light-mode .contact textarea::placeholder {
    color: #94a3b8;
}

body.light-mode .job,
body.light-mode .edu-item {
    border-bottom-color: #cbd5e1;
}

body.light-mode .date {
    color: var(--primary-dark);
}

body.light-mode footer {
    color: #64748b;
}

body.light-mode footer a {
    color: var(--primary-dark);
}

body.light-mode .slider {
    background-color: #cbd5e1;
    border-color: var(--primary);
}

body.light-mode .slider:before {
    background-color: white;
}

body.light-mode .slider .fa-sun,
body.light-mode .slider .fa-moon {
    color: var(--primary-dark);
}

body.light-mode .theme-label {
    color: var(--primary-dark);
}

body.light-mode .lang-btn {
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

body.light-mode .lang-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

body.light-mode .lang-btn:hover:not(.active) {
    background: rgba(183, 75, 237, 0.1);
}

body.light-mode h1 {
    background: linear-gradient(135deg, #1a1a2e, var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .tagline {
    color: var(--primary-dark);
}

body.light-mode .contact-info-header i,
body.light-mode .personal-detail i {
    color: var(--primary-dark);
}

body.light-mode .social-icon {
    background: rgba(183, 75, 237, 0.1);
    color: var(--primary-dark);
}

body.light-mode .social-icon:hover {
    background: var(--primary);
    color: white;
}

body.light-mode .btn-download {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

body.light-mode .btn-secondary {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

body.light-mode .btn-secondary:hover {
    background: rgba(183, 75, 237, 0.1);
}

/* ========== ریسپانسیو (موبایل) ========== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .contact-info-header, .personal-detail {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .control-bar {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* خدمات در موبایل */
    .expertise-grid-2col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .expert-card {
        padding: 1rem;
    }
    
    /* دکمه‌ها در موبایل */
    .btn-cooperation-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .btn-expertise {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    /* سوابق کاری در موبایل */
    .experience .jobs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* دوره‌ها در موبایل */
    .course-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        overflow-x: hidden;
    }
    
    .course-card {
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
        padding: 0.8rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .course-card i {
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    
    .course-card h3 {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .course-card p {
        font-size: 0.75rem;
    }
    
    /* جلوگیری از خروج از عرض */
    .courses {
        overflow-x: hidden;
    }
    
    .courses .course-card div {
        flex: 1;
        min-width: 0;
        word-wrap: break-word;
    }
}