/* FILE: style.css */
/*
Theme Name: KSTP Abozar Amini Theme
Author: mohammad fakoor
Description: A professional bilingual 3D landing page with dynamic blog and gallery.
Version: 1.6
Text Domain: kstp-theme
*/

:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --glass-bg: rgba(18, 22, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-color: #ffffff;
    --text-muted: #a0aec0;
    --success-color: #00ff88;
    --portrait-size: 320px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

body {
    background-color: #000000;
    color: var(--text-color);
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 50px;
}

body.lang-en {
    font-family: 'Roboto', sans-serif;
    direction: ltr;
}

#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

model-viewer {
    width: 100%;
    height: 100%;
    min-width: 100vw; 
    min-height: 100vh;
    transform: scale(1.3); 
    transform-origin: center;
    background: radial-gradient(circle at center, #141b2b 0%, #000000 100%);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ==================== کارت‌های شیشه‌ای ==================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

/* ==================== هیرو کارت مدیریتی ==================== */
.hero-card {
    padding: 30px 40px 40px 40px;
    background: linear-gradient(145deg, rgba(24, 29, 41, 0.85) 0%, rgba(10, 14, 22, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* نوار بالای هیرو کارت (سوییچر زبان و لوگوی بالا سمت چپ) */
.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-top-logo {
    display: flex;
    align-items: center;
}

.hero-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.hero-logo-img:hover {
    transform: scale(1.05);
}

.lang-switcher-hero {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.lang-btn {
    background: transparent;
    border: none;
    color: #a0aec0;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

/* بدنه هیرو */
.hero-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1.2;
    text-align: right;
}

body.lang-en .hero-content {
    text-align: left;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px var(--primary-color); }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-job {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 12px;
}

.hero-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    margin-bottom: 16px;
    border-radius: 2px;
}

.hero-tagline {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 0;
    max-width: 95%;
}

/* ستون عکس پرتره بدون کادر با اندازه داینامیک */
.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}

.hero-portrait-img {
    width: 100%;
    max-width: var(--portrait-size, 320px);
    height: auto;
    max-height: 480px;
    object-fit: contain;
    object-position: bottom center;
    border: none;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.hero-portrait-img:hover {
    transform: translateY(-4px) scale(1.02);
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.8));
}

/* ==================== اطلاعات تماس و شبکه‌های اجتماعی ==================== */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ddd;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.contact-item i { 
    color: var(--primary-color); 
    width: 20px; 
    text-align: center;
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid var(--glass-border);
}

.social-btn:hover { 
    background: var(--primary-color); 
    transform: translateY(-3px); 
}

.save-contact-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.save-contact-btn:hover { 
    filter: brightness(1.15); 
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
}

/* ==================== اسلایدر گالری ==================== */
.slideshow-container {
    position: relative;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.mySlides { display: none; width: 100%; height: 100%; }
.mySlides img { width: 100%; height: 100%; object-fit: cover; }
.fade { animation-name: fade; animation-duration: 1.5s; }
@keyframes fade { from {opacity: .4} to {opacity: 1} }

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    border: 1px solid var(--glass-border);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev:hover, .next:hover { background-color: var(--primary-color); }
.next { left: 10px; }
.prev { right: 10px; }

body.lang-en .next { right: 10px; left: auto; }
body.lang-en .prev { left: 10px; right: auto; }

/* ==================== بخش وبلاگ ==================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.blog-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.06);
}

.post-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.blog-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}

.blog-item p {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px 0;
}

.cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-categories ul li a:hover {
    color: var(--primary-color) !important;
}

/* ==================== مدیا کوئری و ریسپانسیو ==================== */
@media (max-width: 800px) {
    .hero-card {
        padding: 25px 20px;
    }
    .hero-body {
        flex-direction: column-reverse;
        gap: 25px;
    }
    .hero-content {
        text-align: center !important;
    }
    .hero-divider {
        margin: 0 auto 16px auto;
    }
    .hero-tagline {
        max-width: 100%;
    }
    .hero-portrait-img {
        max-width: 220px;
        height: auto;
    }
    .hero-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-copyright p {
        text-align: center !important;
        margin-top: 15px;
    }
}

/* ==================== هدر و منوی بالای سایت ==================== */
.site-header-container {
    padding-bottom: 0 !important;
}

.site-header-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 25px;
    margin-bottom: 20px;
    border-radius: 18px;
}

.main-navigation {
    width: 100%;
    display: flex;
    justify-content: center;
}

.header-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.header-menu-list li {
    position: relative;
}

.header-menu-list li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: inline-block;
}

.header-menu-list li a:hover,
.header-menu-list li.current-menu-item > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
    border: 1px solid rgba(0, 210, 255, 0.4);
}

/* زیرمنوها (Dropdown) در صورت وجود */
.header-menu-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    list-style: none;
    padding: 10px 0;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body.lang-en .header-menu-list .sub-menu {
    right: auto;
    left: 0;
}

.header-menu-list li:hover > .sub-menu {
    display: block;
}

.header-menu-list .sub-menu li a {
    display: block;
    padding: 8px 18px;
    border-radius: 0;
    border: none;
    font-size: 0.85rem;
}

.header-menu-list .sub-menu li a:hover {
    background: rgba(0, 210, 255, 0.15);
    color: var(--primary-color);
}
/* ==================== استایل اختصاصی منوی هدر ==================== */
.header-nav-container {
    margin-top: 20px;
    margin-bottom: 0;
    padding-bottom: 0 !important;
    position: relative;
    z-index: 1000; /* اطمینان از قرارگیری روی سایر المان‌ها */
}

.main-header-nav {
    padding: 10px 25px !important;
    margin-bottom: 15px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible !important; /* بسیار مهم: برای اینکه دراپ‌دان بیرون کارت نمایش داده شود */
}

.nav-menu-list {
    list-style: none; /* حذف دایره‌های کنار لیست */
    display: flex; /* چیدمان کنار هم (افقی) */
    gap: 30px; /* فاصله بین آیتم‌ها */
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu-list li {
    margin: 0;
    padding: 0;
}

.nav-menu-list li a {
    color: #ffffff; /* متن کاملاً سفید */
    text-decoration: none; /* حذف زیرخط لینک */
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: block;
    position: relative;
}

/* افکت هوور (کشیدن ماوس روی منو) */
.nav-menu-list li a:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* خط ظریف زیر منو هنگام هوور */
.nav-menu-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu-list li a:hover::after {
    width: 50%; /* نمایش خط زیرین */
}

ul.nav-menu-list, 
ul.nav-menu-list ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.nav-menu-list {
    display: flex !important;
    flex-direction: row !important; /* منوی اصلی حتماً افقی */
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

ul.nav-menu-list > li {
    position: relative !important;
    margin: 0;
    padding: 0;
}


ul.nav-menu-list > li > a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

ul.nav-menu-list > li > a:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.06);
}

/* اضافه کردن آیکون فلش به منوهای دارای فرزند */
ul.nav-menu-list li.menu-item-has-children > a::after {
    content: "▾";
    font-size: 0.8rem;
    margin-right: 4px;
    transition: transform 0.3s ease;
}

ul.nav-menu-list li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* ==================== دراپ‌دان شناور (Sub-Menu) ==================== */
ul.nav-menu-list .sub-menu {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    right: 0 !important;
    min-width: 220px !important;
    background: rgba(15, 20, 30, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px !important;
    padding: 8px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    
    /* حالت مخفی پیش‌فرض */
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
    transform: translateY(12px) !important;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s !important;
    z-index: 9999 !important;
}

/* نمایش دراپ‌دان با انیمیشن هنگام هاور */
ul.nav-menu-list li:hover > .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* آیتم‌های داخل دراپ‌دان */
ul.nav-menu-list .sub-menu li {
    width: 100% !important;
    list-style: none !important;
    margin: 2px 0 !important;
}

ul.nav-menu-list .sub-menu li a {
    display: block !important;
    padding: 10px 14px !important;
    color: #e0e0e0 !important;
    font-size: 0.88rem !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    text-align: right !important;
    transition: all 0.2s ease !important;
}

ul.nav-menu-list .sub-menu li a:hover {
    background: rgba(0, 210, 255, 0.15) !important;
    color: #00d2ff !important;
    padding-right: 18px !important; /* حرکت کوچک به راست موقع هاور */
}

/* تنظیم جهت برای زبان انگلیسی */
body.lang-en ul.nav-menu-list .sub-menu {
    right: auto !important;
    left: 0 !important;
}
body.lang-en ul.nav-menu-list .sub-menu li a {
    text-align: left !important;
}
body.lang-en ul.nav-menu-list .sub-menu li a:hover {
    padding-right: 14px !important;
    padding-left: 18px !important;
}

/* استایل آیتم فعال (صفحه‌ای که کاربر در آن هست) */
.nav-menu-list li.current-menu-item a {
    color: var(--primary-color);
    background: rgba(0, 210, 255, 0.08);
}

/* ریسپانسیو برای موبایل */
@media (max-width: 600px) {
    .nav-menu-list {
        gap: 10px;
    }
    .nav-menu-list li a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* ==================== اسلایدر افقی نوشته‌ها ==================== */
.blog-header-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.blog-slider-nav {
    display: flex;
    gap: 8px;
}

.blog-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.blog-nav-btn:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* محفظه اسکرول افقی */
.blog-slider-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 4px 15px 4px;
    -webkit-overflow-scrolling: touch;
}

/* کارت‌های افقی */
.horizontal-slide {
    flex: 0 0 290px; /* عرض ثابت هر کارت */
    max-width: 290px;
    scroll-snap-align: start;
}

/* اسکرول‌بار سفارشی و شیک */
.blog-slider-container::-webkit-scrollbar {
    height: 6px;
}

.blog-slider-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.blog-slider-container::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.3);
    border-radius: 10px;
}

.blog-slider-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.post-thumb-placeholder {
    height: 160px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
}

body.lang-en .blog-nav-btn i.fa-chevron-right {
    transform: rotate(180deg);
}
body.lang-en .blog-nav-btn i.fa-chevron-left {
    transform: rotate(180deg);
}

.nav-menu-list li.menu-item-has-children {
    position: relative;
}

.nav-menu-list li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu-list li.menu-item-has-children > a::before {
    content: "\f107"; /* آیکون فلش FontAwesome */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-menu-list li.menu-item-has-children:hover > a::before {
    transform: rotate(180deg);
}

.nav-menu-list .sub-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    right: 0; /* در حالت راست به چپ */
    background: rgba(14, 18, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    margin: 8px 0 0 0;
    
    /* مخفی سازی اولیه همراه با ترنزیشن نرم */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
}

body.lang-en .nav-menu-list .sub-menu {
    right: auto;
    left: 0;
}

.nav-menu-list li.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu-list .sub-menu li {
    width: 100%;
    margin: 0;
}

.nav-menu-list .sub-menu li a {
    display: block;
    padding: 10px 18px;
    color: #ddd;
    font-size: 0.9rem;
    border-radius: 8px;
    margin: 2px 8px;
    border: none;
    text-align: right;
}
body.lang-en .nav-menu-list .sub-menu li a {
    text-align: left;
}

.nav-menu-list .sub-menu li a::after {
    display: none; /* حذف خط زیر لینک برای زیرمنوها */
}

.nav-menu-list .sub-menu li a:hover {
    background: rgba(0, 210, 255, 0.12);
    color: var(--primary-color);
    transform: translateX(-4px);
}

body.lang-en .nav-menu-list .sub-menu li a:hover {
    transform: translateX(4px);
}

/* سطح سوم زیرمنو (در صورت نیاز به زیرمنوی تو در تو) */
.nav-menu-list .sub-menu .sub-menu {
    top: 0;
    right: 100%;
    margin-right: 8px;
}

body.lang-en .nav-menu-list .sub-menu .sub-menu {
    right: auto;
    left: 100%;
    margin-left: 8px;
}

body.lang-fa .menu-en-wrap {
    display: none !important;
}
body.lang-fa .menu-fa-wrap {
    display: block !important;
}

body.lang-en .menu-fa-wrap {
    display: none !important;
}
body.lang-en .menu-en-wrap {
    display: block !important;
}