/* ================= متغیرها و تنظیمات پایه ================= */
:root {
    --primary-dark: #160e0a;
    --secondary-dark: #241812;
    --gold: #d4af37;
    --gold-hover: #f1c953;
    --light-cream: #fdfbf7;
    --text-gray: #bbaea6;
    --transition-smooth: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 90px;
    --controls-h: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--primary-dark);
    color: var(--light-cream);
    width: 100%;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

a, button {
    text-decoration: none;
    color: inherit;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
}

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3, .lalezar {
    font-family: 'Lalezar', 'B Yekan', Tahoma, cursive;
    font-weight: normal;
    font-display: swap;
}

/* ================= ناوبری (Header) ================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(22, 14, 10, 0.95), transparent);
}

.logo {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--gold);
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    margin-inline-start: auto;
    padding-inline-end: 30px;
}

.nav-item {
    font-size: 1rem;
    font-weight: 300;
    transition: color 0.3s;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    color: var(--gold);
    font-weight: 700;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s;
}

.nav-item:hover::after, .nav-item.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ================= اسلایدر اصلی ================= */
.slider-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 20px) 10% calc(var(--controls-h) + 20px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transform: scale(1.05);
    transition: transform 6s ease-out;
}

.overlay-dark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(22, 14, 10, 0.85) 0%, rgba(22, 14, 10, 0.5) 100%);
    z-index: -1;
}

.slide.active .slide-bg {
    transform: scale(1);
}

.slide-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    transform: translateY(40px);
    opacity: 0;
    transition: var(--transition-smooth);
    transition-delay: 0.3s;
}

.slide.active .slide-content {
    transform: translateY(0);
    opacity: 1;
}

/* ================= طراحی اختصاصی هر اسلاید ================= */

/* --- اسلاید 1: ویدیو --- */
.video-overlay-ui {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 6, 4, 0.6);
    backdrop-filter: blur(3px);
    z-index: 2;
    transition: opacity 0.5s ease;
    padding: calc(var(--header-h) + 10px) 6% calc(var(--controls-h) + 10px);
    text-align: center;
}

.video-overlay-ui h1 {
    font-size: clamp(1.8rem, 6vw, 5.5rem);
    color: var(--gold);
    margin-bottom: 30px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    letter-spacing: clamp(1px, 0.5vw, 5px);
    max-width: 100%;
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
}

.play-btn {
    background: var(--gold);
    color: var(--primary-dark);
    font-family: 'Vazirmatn', sans-serif;
    font-size: clamp(0.95rem, 2.5vw, 1.3rem);
    font-weight: 800;
    padding: clamp(10px, 2vw, 15px) clamp(22px, 4vw, 40px);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    animation: pulseGold 2s infinite;
}

.play-btn:hover {
    transform: scale(1.05);
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.6);
    animation: none;
}

.play-icon {
    font-size: 1.8rem;
    line-height: 1;
}

@keyframes pulseGold {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* --- اسلاید 2: داستان ما --- */
.history-slide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    text-align: right;
}

.history-text {
    flex: 1;
}

.history-text h2 {
    font-size: clamp(1.8rem, 5vw, 4rem);
    color: var(--gold);
    margin-bottom: 25px;
    line-height: 1.2;
}

.history-text p {
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 2;
    color: #ddd;
    margin-bottom: 20px;
    font-weight: 300;
    text-align: justify;
}

.history-image {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    position: relative;
}

.history-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.history-image:hover img {
    transform: scale(1.05);
}

/* --- اسلاید 3: ارتباط و لوگو جدید --- */
.contact-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 50px;
}

.contact-info-box {
    flex: 1;
    background: var(--primary-dark);
    border: 1px solid var(--gold);
    padding: 40px;
    border-radius: 25px;
    max-width: 500px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.contact-info-box h2 {
    font-size: clamp(1.6rem, 4vw, 3rem);
    color: var(--gold);
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 10px;
}

.contact-info-box p {
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    color: #ddd;
    margin-bottom: 15px;
    line-height: 1.8;
}

.contact-info-box strong {
    color: var(--gold);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.contact-numbers {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--light-cream);
    direction: ltr;
    display: inline-block;
    letter-spacing: 1px;
    font-weight: bold;
}

.contact-image-container {
    flex: 1;
    max-width: 450px;
    background: #fff;
    padding: 30px;
    border-radius: 30px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-image-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ================= کنترل‌های اسلایدر ================= */
.slider-controls {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 100;
}

.control-btn {
    width: 55px;
    height: 55px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold);
    transition: 0.3s;
    background: rgba(22, 14, 10, 0.7);
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: var(--gold);
    color: var(--primary-dark);
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    cursor: pointer;
}

.dot.active {
    background: var(--gold);
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

/* ================= Modal (ساده و شیک) ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 4, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: rgba(36, 24, 18, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 50px 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.8) translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-box p {
    font-size: 1.5rem;
    color: var(--gold);
    line-height: 1.8;
    margin-bottom: 35px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

.btn-close-modal {
    background: linear-gradient(135deg, var(--gold), #e8c96b);
    color: var(--primary-dark);
    padding: 12px 45px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

.btn-close-modal:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.5);
}

/* ================= Responsive ================= */
header {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-inline-start: max(5%, env(safe-area-inset-left));
    padding-inline-end: max(5%, env(safe-area-inset-right));
}

.slider-controls {
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 992px) {
    .history-slide {
        flex-direction: column-reverse;
        text-align: center;
        gap: 20px;
    }

    .history-image {
        width: 90%;
    }

    .contact-layout {
        flex-direction: column-reverse;
        gap: 30px;
        text-align: center;
    }

    .contact-image-container {
        width: 80%;
    }

    .video-overlay-ui h1 {
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 70px;
        --controls-h: 80px;
    }

    header {
        padding-top: max(15px, env(safe-area-inset-top));
        padding-bottom: 15px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        inset-inline-end: 5%;
        top: calc(var(--header-h));
        flex-direction: column;
        align-items: flex-end;
        gap: 1.2rem;
        background: rgba(22, 14, 10, 0.97);
        border: 1px solid rgba(212, 175, 55, 0.25);
        border-radius: 16px;
        padding: 20px 25px;
        min-width: 180px;
        margin-inline-start: 0;
        padding-inline-end: 25px;
        transform: translateY(-15px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: 0.3s ease;
        z-index: 99;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .history-text p {
        padding: 0 10px;
    }

    .history-image {
        width: 100%;
    }

    .contact-layout {
        gap: 20px;
    }

    .contact-image-container {
        width: 90%;
        padding: 10px;
    }

    .contact-info-box {
        padding: 20px;
    }

    .play-btn {
        gap: 8px;
    }

    .slider-controls {
        bottom: 15px;
        gap: 20px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .modal-box {
        padding: 30px 20px;
    }

    .modal-box p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

    .btn-close-modal {
        padding: 10px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    :root {
        --header-h: 64px;
        --controls-h: 76px;
    }

    .slide {
        padding-inline: 6%;
    }

    .contact-info-box, .modal-box {
        padding: 16px;
    }

    .slider-controls {
        gap: 12px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-height: 420px) and (orientation: landscape) {
    :root {
        --header-h: 56px;
        --controls-h: 60px;
    }

    .video-overlay-ui h1 {
        margin-bottom: 14px;
    }
}
