/* style.css - نسخه کامل، نهایی و با استایل‌های شرطی برای اسلایدر */

/* --- فونت‌ها و کتابخانه آیکون --- */
@import url('');
@import url('/fontawesome/css/all.min.css');

/* --- تنظیمات کلی --- */
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Vazirmatn', sans-serif;
    margin: 0;
    padding: 0;
    direction: rtl;
    background-color: #cfe4ff;
    color: #333;
}

/* 
================================================================
    بخش جدید: استایل‌های اختصاصی صفحه اصلی (Homepage)
================================================================
*/

/* --- اسلایدر اصلی (فقط در صفحه اصلی) --- */
#homepage .main-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}
#homepage .swiper-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}
#homepage .slide-content { max-width: 800px; padding: 2rem; animation: fadeIn 1.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
#homepage .slide-content h1 { font-size: clamp(3rem, 6vw, 5rem); color: white; text-shadow: 2px 2px 10px rgba(0,0,0,0.7); margin-bottom: 1rem; }
#homepage .slide-content p { font-size: clamp(1.2rem, 3vw, 1.6rem); text-shadow: 1px 1px 5px rgba(0,0,0,0.7); }
:root { --swiper-theme-color: #ffffff; --swiper-navigation-size: 30px; }
.swiper-button-next, .swiper-button-prev { color: var(--swiper-theme-color) !important; text-shadow: 0 0 8px rgba(0,0,0,0.6); }
.swiper-pagination-bullet { background: var(--swiper-theme-color) !important; width: 12px; height: 12px; opacity: 0.7; transition: all 0.3s ease; }
.swiper-pagination-bullet-active { opacity: 1; transform: scale(1.2); }

/* --- لایه تیره (فقط در صفحه اصلی) --- */
#homepage .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    
    z-index: 2;
}

/* 
================================================================
    استایل‌های عمومی (مشترک بین همه صفحات)
================================================================
*/

/* --- هدر (استایل عمومی) --- */
header {
    background-color: rgba(10, 20, 30, 0.85);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

/* --- استایل هدر شفاف (فقط برای صفحه اصلی) --- */
#homepage header {
    background-color: transparent;
    position: absolute; /* روی اسلایدر */
    width: 100%;      /* <-- این خط مشکل را حل می‌کند */

}
#homepage header.scrolled {
    position: fixed;
    background-color: rgba(10, 20, 30, 0.85);
}

/* --- محتوای اصلی (عمومی) --- */
main {
    background: #cfe4ff;
}

/* --- فاصله بالای محتوا (فقط برای صفحه اصلی) --- */
#homepage main {
    margin-top: 100vh;
    position: relative;
    z-index: 5;
}

nav { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
nav .logo { font-family: 'Lalezar', cursive; font-size: 2rem; }
nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
nav a { color: white; text-decoration: none; font-size: 1.1rem; transition: color 0.3s; }
nav a:hover { color: #ffd700; }

.container { max-width: 1200px; margin: 4rem auto; padding: 2rem; background-color: #7fbfbc; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
h1, h2 { font-family: 'Lalezar', cursive; color: #0056b3; }

/* --- بخش ویژگی‌ها --- */
.features-container { margin-top: -80px; position: relative; z-index: 10; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-item { background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); text-align: center; border: 1px solid #eee; transition: transform 0.3s, box-shadow 0.3s; }
.feature-item:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
.feature-item i { font-size: 3rem; color: #007bff; margin-bottom: 1rem; }
.feature-item h3 { font-family: 'Tanha', sans-serif; font-size: 1.6rem; color: #333; margin: 0 0 0.5rem 0; }
.feature-item p { font-size: 0.9rem; line-height: 1.8; color: #666; }

/* --- کارت‌های تور (استایل کلی) --- */
.tours-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(340px,1fr)); gap: 2rem; }
.tour-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.1); transition: all .3s ease; display: flex; flex-direction: column; }
.tour-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.tour-card img { width: 100%; height: 220px; object-fit: cover; }
.tour-card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.tour-card h3 { margin-top: 0; font-family: 'Lalezar', cursive; }
.tour-card-content p { line-height: 1.8; }
.price-list { list-style: none; padding: 0; margin: 1rem 0; }
.price-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: 1px solid #eee; border-radius: 5px; margin-bottom: 5px; cursor: pointer; transition: background-color .2s ease-in-out,border-color .2s ease-in-out; }
.price-item:hover { background-color: #f8f9fa; border-color: #ddd; }
.price-item.selected { background-color: #d4edda; border-color: #c3e6cb; font-weight: 700; }
.price-item.selected .star { color: #ffc107; }
.star { color: #ffd700; }
.btn-book { display: block; width: 100%; padding: .8rem; background-color: #28a745; color: white; text-align: center; text-decoration: none; border-radius: 5px; font-weight: 700; transition: background-color .3s; }
.btn-book:hover { background-color: #218838; }

/* --- استایل بخش تورهای پیشنهادی --- */
.random-tours-section { background-color: #cfe4ff; padding: 50px 2rem; border-top: 0px solid #e9ecef; border-bottom: 0px solid #e9ecef; }
.random-tours-section h2 { text-align: center; font-size: 2.8rem; margin-bottom: 15px; }
.random-tours-section > .container > p { text-align: center; font-size: 1.1rem; color: #6c757d; max-width: 600px; margin: 0 auto 40px auto; }
.random-tours-section .tours-grid { grid-template-columns: repeat(auto-fit, minmax(var(--min-card-width, 340px), 1fr)); }
.random-tours-section .tour-card img { height: var(--card-image-height, 220px); }
.random-tours-section .tour-card-content p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis; min-height: 70px; margin-bottom: 1.5rem; }
.tour-card-footer { margin-top: auto; text-align: center; }
.random-tours-section .tour-card-footer .btn-book { display: inline-block; width: auto; padding: 0.8rem 2rem; background-color: #007bff; }
.random-tours-section .tour-card-footer .btn-book:hover { background-color: #0056b3; }
.tour-card.highlighted { box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.6); transform: scale(1.02); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }

/* --- استایل‌های فرم تماس --- */
.contact-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; align-items: flex-start; }
.contact-info h3 { font-family: 'Lalezar', cursive; border-bottom: 2px solid #007bff; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.contact-info p { line-height: 2; font-size: 1.1rem; }
.contact-form .form-group { margin-bottom: 1.5rem; }
.contact-form label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 5px; font-family: 'Vazirmatn', sans-serif; box-sizing: border-box; }
.contact-form button { padding: 0.8rem 2rem; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1.1rem; font-family: 'Lalezar', cursive; transition: background-color 0.3s; }
.contact-form button:hover { background-color: #0056b3; }

/* --- استایل‌های فوتر --- */
footer { background-color: #343a40; color: #f8f9fa; padding: 40px 20px; margin-top: 40px; direction: rtl; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.footer-section h4 { font-family: 'Lalezar', cursive; font-size: 1.5rem; color: #ffd700; margin-top: 0; margin-bottom: 20px; border-bottom: 2px solid #555; padding-bottom: 10px; }
.footer-section p, .footer-section a { color: #ccc; text-decoration: none; line-height: 1.8; font-size: 0.95rem; }
.footer-section a:hover { color: white; text-decoration: underline; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.enamad-icons { display: flex; gap: 15px; align-items: center; }
.enamad-icons a { display: block; width: 80px; height: 80px; background-color: #f1f1f1; border-radius: 8px; text-align: center; line-height: 80px; font-size: 0.8rem; color: #333; border: 1px solid #ddd; }
.enamad-icons a img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #555; font-size: 0.9rem; color: #aaa; }

/*
    بخش چت آنلاین (نسخه بازطراحی شده)
================================================================
*/

/* --- کانتینر اصلی ویجت --- */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

/* --- حباب چت --- */
.chat-bubble {
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}
.chat-bubble:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* --- پنجره چت --- */
.chat-window {
    width: 370px;
    max-width: calc(100vw - 30px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header { background: #007bff; color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.chat-header h4 { margin: 0; font-family: 'Lalezar', cursive; font-size: 1.2rem; }
.close-chat-btn { background: none; border: none; color: white; font-size: 28px; cursor: pointer; opacity: 0.8; line-height: 1; }
.close-chat-btn:hover { opacity: 1; }

.chat-body { flex-grow: 1; padding: 15px; overflow-y: auto; background-color: #f4f7f9; display: flex; flex-direction: column; gap: 10px; }

/* --- استایل پیام‌ها (مشترک برای سایت و پنل) --- */
.chat-message {
    padding: 10px 18px;
    border-radius: 20px;
    max-width: 85%;
    line-height: 1.6;
    word-wrap: break-word;
}
.chat-message.user {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}
.chat-message.admin {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}
.chat-message .timestamp { display: block; font-size: 0.7rem; opacity: 0.7; margin-top: 5px; text-align: left; }
.chat-message.user .timestamp { color: #d4e8ff; }
.chat-message.admin .timestamp { color: #888; }

.chat-footer { padding: 10px 15px; display: flex; align-items: center; background: #fff; border-top: 1px solid #ddd; }
#chat-input, #admin-chat-input { flex-grow: 1; border: none; background: #f0f2f5; border-radius: 20px; padding: 12px 18px; font-family: 'Vazirmatn', sans-serif; font-size: 0.95rem; }
#send-chat-btn, #admin-send-btn { background: #007bff; color: white; border: none; width: 44px; height: 44px; border-radius: 50%; margin-right: 10px; cursor: pointer; font-size: 18px; transition: background-color 0.3s; display: flex; align-items: center; justify-content: center; }
#send-chat-btn:hover, #admin-send-btn:hover { background-color: #0056b3; }

/* --- استایل‌های واکنش‌گرایی برای موبایل --- */
@media (max-width: 480px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        bottom: 0;
        right: 0;
        box-shadow: none;
    }
    .chat-widget-container.chat-open .chat-bubble {
        transform: scale(0); /* مخفی کردن حباب وقتی چت باز است */
    }
}
/* --- استایل دکمه حذف مکالمه در پنل --- */
.conversation-item {
    position: relative; /* برای جای‌گیری صحیح دکمه */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.conv-item-main {
    flex-grow: 1;
    overflow: hidden; /* برای کارکرد صحیح ellipsis */
}
.btn-delete-conv {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 22px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 5px 10px;
    line-height: 1;
}
.conversation-item:hover .btn-delete-conv {
    opacity: 0.7;
}
.btn-delete-conv:hover {
    opacity: 1;
}
/* --- استایل‌های فرم اطلاعات کاربر در ویجت چت --- */
#chat-info-form {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#chat-info-form .form-intro {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
}
#chat-info-form .form-group {
    margin-bottom: 15px;
}
#chat-info-form label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}
#chat-info-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}
#chat-info-form .form-footer {
    margin-top: 10px;
}
#start-chat-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Lalezar', cursive;
    transition: background-color 0.3s;
}
#start-chat-btn:hover {
    background: #218838;
}

/* --- استایل‌های کلی هدر --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.3); /* پس زمینه شیشه‌ای تیره */
    backdrop-filter: blur(10px); /* افکت بلور */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* وقتی اسکرول می‌شود (با جاوا اسکریپت کلاس sticky اضافه می‌شود - اختیاری) */
.main-header.sticky {
    background: rgba(0, 0, 0, 0.9);
    padding: 5px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* استایل لوگو */
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

/* استایل لیست منو */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

/* افکت هاور لینک‌ها */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    right: 0; /* برای راست‌چین */
    background-color: #f39c12; /* رنگ نارنجی یا رنگ برند شما */
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #f39c12;
}

/* دکمه همبرگری (پیش‌فرض مخفی در دسکتاپ) */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* --- ریسپانسیو برای موبایل (زیر 768 پیکسل) --- */
@media (max-width: 768px) {
    .hamburger {
        display: block; /* نمایش دکمه در موبایل */
        z-index: 1001;
    }

    /* تبدیل شدن همبرگر به ضربدر */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* منوی کشویی موبایل */
    .nav-menu {
        position: fixed;
        right: -100%; /* خارج از صفحه از سمت راست */
        top: 0;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.95);
        width: 70%; /* عرض منو */
        height: 100vh; /* تمام ارتفاع صفحه */
        text-align: center;
        transition: 0.4s;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        padding-top: 80px; /* فاصله از بالا */
        gap: 25px;
        z-index: 999;
    }

    .nav-menu.active {
        right: 0; /* آوردن منو به داخل صفحه */
    }

    .nav-item {
        margin: 10px 0;
    }

    .nav-link {
        font-size: 1.2rem;
        display: block;
        width: 100%;
    }
}
/* تنظیمات هدر برای صفحات داخلی */
.main-header.header-dark {
    background-color: #1a1a1a; /* رنگ تیره برای دیده شدن منو در پس‌زمینه سفید */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); /* سایه ملایم */
}

/* رنگ اکتیو برای لینک صفحه جاری */
.nav-link.active {
    color: #ffd700; /* مثلا رنگ طلایی یا هر رنگی که دوست دارید */
    font-weight: bold;
    border-bottom: 2px solid #ffd700;
}

