/* ============================================================
   استایل‌های اختصاصی صفحه (منتقل‌شده از <style> داخل index.html)
   ============================================================ */
:root {
    --bg: #f9f9f9;
    --card-bg: #ffffff;
    --text: #212529;
    --text-muted: #5b6270;      /* کمی تیره‌تر شد برای رعایت کنتراست WCAG AA روی پس‌زمینه روشن */
    --shadow: rgba(0,0,0,.06);
    --border: #e9ecef;
    --primary: #2b3a51;
    --accent: #a97a35;          /* رنگ ثانویه (برنزی/طلایی) برای متمایز کردن CTAهای مهم از اکشن‌های عادی */
    --accent-soft: rgba(169,122,53,.10);
}

html[data-theme="dark"] {
    --bg: #14181f;
    --card-bg: #1d232d;
    --text: #e9ecef;
    --text-muted: #a8b0bb;
    --shadow: rgba(0,0,0,.35);
    --border: #2b3341;
    --primary: #3b5372;
    --accent: #c99a52;
    --accent-soft: rgba(201,154,82,.12);
}

* { transition: background-color .3s ease, color .3s ease, border-color .3s ease; }

body {
    font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
h1, h2, h3, h4, h5, .sname, .subheading { font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif; }
a { color: inherit; }

.pdf-buttons a { margin-inline-start: 8px; margin-bottom: 10px; }
.pdf-embed { background: var(--card-bg); border-radius:16px; padding:16px; box-shadow:0 6px 20px var(--shadow); }

.section-card {
    background: var(--card-bg);
    border-radius:16px;
    padding:30px;
    box-shadow:0 6px 20px var(--shadow);
    width: 100%;
    box-sizing: border-box;
    color: var(--text);
}

.fa-ul { margin-right: 0; padding-right: 40px; }
.fa-ul li { position: relative; padding-right: 0; margin-bottom: 10px; }
.fa-li { right: -40px; position: absolute; color: var(--primary); }

/* دکمه‌های "دیگر ..." تمام‌عرض */
.btn-wide {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.btn.bg-primary {
    background: var(--primary) !important;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, background-color .3s ease;
}
.btn.bg-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(43,58,81,.35);
}

/* دکمه با رنگ ثانویه - برای اقدامات با اهمیت متفاوت (مثل توضیح رسمی) که نباید با CTAهای اصلی هم‌وزن باشد */
.btn.bg-accent {
    background: var(--accent) !important;
    color:#fff !important;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn.bg-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(169,122,53,.3); color:#fff !important; }

/* عنوان بخش‌ها */
.resume-section h3 {
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
    font-weight: 800;
    margin-bottom: 1.5rem;
}
.resume-section h3::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 40%, transparent 100%);
}

/* Navbar رنگ هماهنگ با primary */
.navbar.bg-primary,
#sideNav.bg-primary {
    background-color: #2b3a51 !important;
}
html[data-theme="dark"] .navbar.bg-primary,
html[data-theme="dark"] #sideNav.bg-primary {
    background-color: #1a2332 !important;
}

/* ===== Hero ===== */
.hero-wrap { position: relative; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(43,58,81,.15) 0%, rgba(43,58,81,.55) 60%, rgba(43,58,81,.85) 100%);
    pointer-events: none;
}
html[data-theme="dark"] .hero-overlay {
    background: linear-gradient(180deg, rgba(20,24,31,.25) 0%, rgba(20,24,31,.65) 60%, rgba(20,24,31,.90) 100%);
}
.hero-cta { display:flex; flex-wrap:wrap; gap:14px; margin: 1.5rem 0 2rem; }
.hero-cta a {
    display:inline-flex; align-items:center; gap:8px;
    padding:12px 26px; border-radius:10px; font-weight:700; text-decoration:none;
}
.hero-cta .cta-primary { background: var(--primary); color:#fff !important; }
.hero-cta .cta-secondary { background: transparent; color: var(--primary) !important; border:2px solid var(--primary); }
.hero-cta a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(43,58,81,.25); }

/* زیرعنوان کوتاه زیر H1 - برای context سریع پیش از پاراگراف بلند */
.tagline {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.05rem;
    margin: .5rem 0 0;
    line-height: 1.9;
}

/* پاراگراف اصلی معرفی - خوانایی بهتر با line-height بالاتر */
.lead {
    line-height: 2;
}

/* ===== Timeline (سوابق) ===== */
.timeline {
    position: relative;
    padding-right: 28px;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding-top: 8px;
    padding-bottom: 8px;
}
.timeline::before {
    content: "";
    position: absolute;
    right: 8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary) 30%, var(--border) 100%);
    border-radius: 3px;
}
.timeline-item {
    position: relative;
    padding-right: 32px;
    margin-bottom: 1.6rem;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    right: -1px;
    top: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 3px var(--primary);
    z-index: 2;
    transition: background .25s, box-shadow .25s;
}
.timeline-item:hover::before {
    background: #0dcaf0;
    box-shadow: 0 0 0 3px #0dcaf0;
}
.timeline-item .resume-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    transition: transform .25s, box-shadow .25s;
}
.timeline-item:hover .resume-content {
    transform: translateX(-4px);
    box-shadow: 0 8px 20px var(--shadow);
}
.timeline-item .resume-content h4 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.timeline-item .subheading {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 6px;
}
.timeline-item .resume-content p {
    margin-bottom: 0;
    font-size: 0.95rem;
}
/* نشان «سِمَت فعلی» - برای متمایز کردن جایگاه کنونی از سوابق قبلی در تایم‌لاین */
.badge-current {
    display:inline-block;
    font-size:.68rem;
    font-weight:700;
    background: var(--accent-soft);
    color: var(--accent);
    border:1px solid var(--accent);
    padding:2px 10px;
    border-radius:20px;
    line-height:1.6;
}

/* ===== News Grid (اخبار) ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.news-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none !important;
    color: var(--text) !important;
    font-weight: 500;
    font-size: .95rem;
    line-height: 1.7;
    height: 100%;
    box-sizing: border-box;
}
.news-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 18px var(--shadow);
    transform: translateY(-3px);
}
.news-card .news-source {
    display:flex; align-items:center; justify-content: flex-end;
    margin-top: 12px;
    font-size: .75rem;
    color: var(--text-muted);
    gap: 6px;
}
.news-card .news-source img.favicon {
    width:16px; height:16px; border-radius:3px; object-fit:contain; flex-shrink:0;
}
/* آیتم‌های اضافی اخبار که پشت دکمه «نمایش بیشتر» مخفی می‌شوند */
.news-card.news-extra { display: none; }
.news-grid.expanded .news-card.news-extra { display: flex; }

.list-extra { display:none; }
.section-card.expanded .list-extra { display: list-item; }

/* دکمه نمایش بیشتر/کمتر برای فهرست‌های بلند */
.btn-show-more {
    display:inline-flex; align-items:center; gap:6px;
    background:transparent; border:1px solid var(--border);
    color: var(--primary); font-weight:600; font-size:.85rem;
    padding:8px 18px; border-radius:20px; cursor:pointer; margin-top:14px;
}
.btn-show-more:hover { border-color: var(--primary); background: var(--accent-soft); }
.btn-show-more i { transition: transform .25s; }
.btn-show-more.open i { transform: rotate(180deg); }

.card { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

/* اضافه کردن آیکون به انتهای لینک‌های بخش ویدیو */
.card-body a::after {
  content: "\f0c1"; /* کد آیکون fa-external-link-alt */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 6px;
  color: #6c757d;
}
.card-body a {
  color: #0dcaf0 !important;
  text-decoration: none;
  font-weight: 500;
}

/* ===== ویدیوها ===== */
#multimedia .video-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
#multimedia .card .position-relative {
    height: 170px;
    overflow: hidden;
    background: #111;
}
#multimedia .card .card-img-top {
    width: 100%;
    height: 170px;
    object-fit: cover;
    object-position: center center;
}
#multimedia .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
#multimedia .card .card-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* موبایل: کارت‌های ویدیو به‌صورت اسکرول افقی (carousel) به‌جای ستون بلند عمودی */
@media (max-width: 767.98px) {
    #multimedia .video-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: .85rem;
        padding-bottom: .5rem;
        -webkit-overflow-scrolling: touch;
    }
    #multimedia .video-row::-webkit-scrollbar { height: 6px; }
    #multimedia .video-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    #multimedia .video-row > div {
        flex: 0 0 78%;
        scroll-snap-align: start;
    }
    #multimedia .card .position-relative,
    #multimedia .card .card-img-top {
        height: 200px;
    }
}

/* Timeline active state (اسکرول) */
.timeline-item.active::before {
    background: #0dcaf0 !important;
    box-shadow: 0 0 0 3px #0dcaf0 !important;
    transform: scale(1.15);
}
.timeline-item.active .resume-content {
    border-color: var(--primary);
    box-shadow: 0 6px 18px var(--shadow);
}

/* ===== Languages ===== */
.language-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.language-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    text-decoration: none !important;
    color: var(--text) !important;
    transition: all 0.25s ease;
}
.language-card:hover {
    border-color: var(--primary);
    transform: translateX(-4px);
    box-shadow: 0 6px 16px var(--shadow);
}
.language-card.current {
    border-color: var(--primary);
    background: rgba(43, 58, 81, 0.06);
}
html[data-theme="dark"] .language-card.current {
    background: rgba(59, 83, 114, 0.2);
}
.language-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}
.language-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.lang-name {
    font-weight: 700;
    font-size: 1rem;
}
.lang-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.lang-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.25s;
}
.language-card:hover .lang-arrow {
    transform: translateX(-4px);
    color: var(--primary);
}

html[data-theme="dark"] .official-links img {
    filter: invert(1) brightness(1.35) contrast(1.05);
}

/* ===== Desktop toggle button ===== */
#desktopToggle {
    position: fixed;
    left: 20px;
    bottom: 140px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
    z-index: 1000;
    cursor: pointer;
}
#desktopToggle:hover { transform: translateY(-2px); }
#desktopToggle.active { background: #0dcaf0; color: #111; }

html.desktop-mode body {
    min-width: 1100px;
    overflow-x: auto;
}

/* ========== SIDEBAR: force TOP alignment (override all.css) ========== */
@media (min-width: 992px) {
    #sideNav.navbar,
    #sideNav {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1rem !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        text-align: center !important;
    }
    #sideNav .navbar-brand {
        display: block !important;
        margin: 0 auto 1rem auto !important;
        padding: 0 !important;
    }
    #sideNav .navbar-brand .img-profile {
        max-width: 8rem !important;
        margin: 0 auto !important;
    }
    #sideNav .navbar-collapse,
    #sideNav #navbarSupportedContent {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        flex-grow: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #sideNav .navbar-nav {
        margin: 0 !important;
        padding: 0 0.5rem !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    #sideNav .nav-item {
        margin: 0 !important;
    }
    #sideNav .nav-link {
        padding: 0.45rem 1rem !important;
    }
}
html.desktop-mode #sideNav.navbar,
html.desktop-mode #sideNav {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding-top: 1.5rem !important;
    height: 100vh !important;
    overflow-y: auto !important;
}
html.desktop-mode #sideNav .navbar-collapse,
html.desktop-mode #sideNav #navbarSupportedContent {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    flex-grow: 0 !important;
    width: 100% !important;
}
html.desktop-mode #sideNav .navbar-nav {
    margin: 0 !important;
    justify-content: flex-start !important;
}

/* ========== REDUCE GAPS between all sections ========== */
.resume-section.d-flex,
.resume-section.d-flex.flex-column {
    display: block !important;
    align-items: flex-start !important;
}
.resume-section {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    width: 100% !important;
}
.resume-section > div > *:last-child,
.resume-section > *:last-child {
    margin-bottom: 0 !important;
}
.social-icons-wrap {
    margin-bottom: 0 !important;
}
@media (min-width: 992px) {
    .resume-section.p-lg-5,
    .resume-section.p-3.p-lg-5 {
        padding: 0.85rem 1.75rem !important;
    }
}
@media (min-width: 768px) {
    section.resume-section {
        min-height: auto !important;
    }
}
.resume-section h3.mb-5,
.resume-section h3 {
    margin-bottom: 0.85rem !important;
}
.resume-item.mb-5 {
    margin-bottom: 0.75rem !important;
}
.timeline-item {
    margin-bottom: 0.75rem !important;
}
.section-card,
.resume-section .section-card,
.resume-section ul.section-card,
#interests .section-card,
#interests ul {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
#interests,
#interests > div {
    width: 100% !important;
}
hr.m-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
#about {
    padding-bottom: 0.5rem !important;
}
#about .hero-cta {
    margin-bottom: 1rem !important;
}
footer {
    margin-top: 1.25rem !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

/* Hamburger without Bootstrap JS */
#navbarSupportedContent.show-mobile-menu {
    display: block !important;
}
@media (min-width: 992px) {
    #navbarSupportedContent.show-mobile-menu {
        display: flex !important;
    }
}

/* ===== Dark mode toggle ===== */
#themeToggle {
    position: fixed;
    left: 20px;
    bottom: 80px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
    z-index: 1000;
    cursor: pointer;
}

/* ===== Back to top ===== */
#backToTop {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
    z-index: 1000;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ===== Navbar active link ===== */
.navbar-nav .nav-link.active {
    color: #fff !important;
    font-weight: 700;
    position: relative;
}
.navbar-nav .nav-link.active::after {
    content: "";
    position: absolute;
    right: 12px;
    left: 12px;
    bottom: 2px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

footer{
    background: var(--card-bg);
    margin-top:60px;
    padding:30px 15px;
    border-top:1px solid var(--border);
}
footer a {
    color: #007bff;
    text-decoration: none;
}
footer a:hover {
    color: #0aa8cc;
    text-decoration: none;
}

/* ===== توضیح رسمی/تکذیب — نوار جمع‌وجور به‌جای کارت هم‌وزن با معرفی اصلی ===== */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 14px 18px;
    flex-wrap: wrap;
}
.notice-bar .notice-icon {
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.notice-bar .notice-text {
    flex: 1 1 260px;
    font-size: .92rem;
    line-height: 1.8;
}
.notice-bar .notice-text strong { color: var(--accent); }

/* ===== انیمیشن ورود هنگام اسکرول — جایگزین سبک AOS با IntersectionObserver ساده ===== */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease, transform .6s ease;
}
[data-reveal].in-view {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ===== بنر نصب سفارشی PWA (Add to Home Screen) ===== */
/* کارت جمع‌وجور شناور، هم‌ردیف با دکمه‌های شناور دیگر (تم/بازگشت به بالا)، نه یک نوار پهن */
#installBanner {
    position: fixed;
    left: 80px; /* کنار ستون دکمه‌های شناور (دسکتاپ/تم/بازگشت به بالا)، نه روی آن‌ها */
    bottom: -140px;
    width: 300px;
    max-width: calc(100vw - 100px);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    padding: 14px;
    z-index: 1000;
    transition: bottom .35s ease;
}
#installBanner.show { bottom: 16px; }

#installBanner .install-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
#installBanner .install-icon {
    width: 40px; height: 40px; border-radius: 10px;
    flex-shrink: 0; object-fit: cover;
}
#installBanner .install-text { flex: 1 1 auto; min-width: 0; }
#installBanner .install-text strong {
    display: block; font-size: .88rem; color: var(--text); margin-bottom: 2px;
}
#installBanner .install-text span {
    display: block; font-size: .74rem; color: var(--text-muted); line-height: 1.5;
}
#installBanner .install-actions {
    display: flex; align-items: center; gap: 8px;
}
#installBanner button {
    font-family: inherit; border: none; cursor: pointer; border-radius: 8px;
    font-weight: 600; font-size: .8rem;
}
#installBanner .btn-install-primary {
    flex: 1 1 auto;
    background: var(--primary); color: #fff; padding: 8px 14px;
}
#installBanner .btn-install-primary:hover { opacity: .9; }
#installBanner .btn-install-dismiss {
    background: transparent; color: var(--text-muted); padding: 8px 12px;
    font-size: 1rem; line-height: 1; border: 1px solid var(--border); border-radius: 8px;
}

@media (max-width: 480px) {
    #installBanner { left: 80px; width: calc(100vw - 96px); }
    #installBanner.show { bottom: 16px; }
}