/* ---------------------------------------------------------------------- */
/* ۱. پالت رنگی و متغیرها */
/* ---------------------------------------------------------------------- */
:root {
    --bg: #A52A2A; /* رنگ اصلی: شرابی/قهوه ای تیره */
    --text: #2c3e50; /* رنگ متن اصلی: آبی-خاکستری تیره */
    --main-glass-bg: rgba(255, 255, 255, 0.15); 
    --desc-color: #555; 
    --menu-panel-bg: #ffffffea; 
    --glass-border: 1px solid rgba(255, 255, 255, 0.2); 
    --blur-strength: 10px; 
    --cal-today-bg: #DCDCDC; 
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* تصویر پس زمینه */
    background-image: url('images/background.jpeg'); 
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    overflow-x: hidden;
}

.app-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--main-glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    border-left: var(--glass-border);
    border-right: var(--glass-border);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* ---------------------------------------------------------------------- */
/* ۲. استایل هدر و اسلایدشو جدید JS */
/* ---------------------------------------------------------------------- */
.header-logo-container {
    width: 100%;
    height: 200px; 
    position: relative;
    overflow: hidden;
    border-bottom: var(--glass-border);
}

header {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

header img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: block;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    position: relative;
}

.header-title {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

/* استایل‌های جدید اسلایدشوی جاوااسکریپتی */
.js-carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 200px; /* اطمینان از حداقل ارتفاع */
    z-index: 1; 
    overflow: hidden; 
    display: block !important;
}

/* تضمین ارتفاع کامل برای حل مشکل رندرینگ در موبایل */
.js-carousel-container,
.carousel-track,
.slide {
    width: 100%;
    height: 100%;
    min-height: 200px; /* جلوگیری از کوچک شدن بیش از حد */
    touch-action: manipulation; /* بهبود تاچ در موبایل */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0; 
    transition: opacity 1s ease-in-out; 
    display: flex; 
    justify-content: center;
    align-items: center;
    will-change: opacity; /* بهبود عملکرد انیمیشن در موبایل */
}

.slide.active {
    opacity: 1; 
}

/* استایل تگ <img> داخلی */
.slide img {
    width: 100%; 
    height: 100%; 
    min-width: 100%; /* اطمینان از پر شدن عرض */
    min-height: 100%; /* اطمینان از پر شدن ارتفاع */
    object-fit: cover; /* تصویر کل فضا را پر کند */
    display: block !important; /* force display */
    object-position: center; /* مرکز کردن تصویر */
}

/* افکت تیره شدن روی هر اسلاید */
.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0); 
    z-index: 2; /* برای اینکه روی تصویر قرار گیرد اما زیر لوگو */
    pointer-events: none; /* تا روی کلیک‌های ناوبری تداخلی ایجاد نکند */
}

/* استایل دکمه‌های چپ و راست */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(0, 0, 0, 0);
    color: rgba(255, 255, 255, 0);
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    transition: background-color 0.3s;
    border-radius: 5px;
}

.carousel-nav-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.prev-btn {
    right: 15px;
}

.next-btn {
    left: 15px;
}

/* استایل دات‌های ناوبری */
.carousel-nav-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 8px;
}

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

.dot-js.active {
    background-color: var(--bg); 
    transform: scale(1.2);
}

/* ---------------------------------------------------------------------- */
/* ۳. استایل دکمه‌های اصلی و لیست دسته‌بندی */
/* ---------------------------------------------------------------------- */
#main-content-wrapper {
    flex-grow: 1;
    width: 100%;
    padding-top: 25px;
    z-index: 5;
    position: relative;
    padding-bottom: 30px;
}

.intro-text {
    max-width: 600px;
    margin: 25px auto 25px;
    padding: 0 20px;
    text-align: center;
    font-size: 17px;
    color: rgb(255, 255, 255);
    line-height: 1.7;
    font-weight: 600;
    text-shadow: 0 0 4px rgb(255, 255, 255);
}

#main-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 35px;
    padding: 0 20px;
}

.main-button {
    flex-grow: 1;
    padding: 14px 25px;
    font-size: 18px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text);
    box-shadow: 0 4px 10px rgba(94, 93, 93, 0.089);
    touch-action: manipulation; /* بهبود کلیک در موبایل */
    -webkit-tap-highlight-color: transparent; /* حذف highlight آبی در اندروید */
}

.main-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(221, 11, 11, 0.363);
}

.main-button.active {
    background-color: var(--bg);
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--bg);
    transform: translateY(-1px);
}

.main-button:not(.active) {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.category-list {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
    display: none; 
    padding-bottom: 50px;
}

.category-list.visible {
    display: block; 
}

.category-item {
    background: #f9f9f92d;
    border: 1px solid #8685855b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
    color: var rgb(255, 255, 255);
    padding: 20px 25px;
    margin-bottom: 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 19px;
    font-weight: 600;
    transition: all 0.25s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 5px solid transparent;
}

.category-item:hover {
    transform: translateY(-5px);
    background: #ffffff00;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-right: 5px solid var(--bg);
}

.category-item::after {
    content: '→';
    font-size: 20px;
    margin-right: 10px;
    color: var(--text);
    transform: rotate(180deg);
    display: inline-block;
    opacity: 0.7;
}

/* ---------------------------------------------------------------------- */
/* ۴. استایل پنل منو و درباره ما */
/* ---------------------------------------------------------------------- */
#menuPanel, #aboutPanel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 700px;
    height: 100%;
    z-index: 100;
    background-color: var(--menu-panel-bg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.329);
    transition: right 0.4s ease-out;
    overflow-y: auto;
    padding-bottom: 30px;
    color: var(--text);
}

#menuPanel.open, #aboutPanel.open {
    right: 0;
}

.menu-header {
    position: sticky;
    top: 0;
    background-color: var(--menu-panel-bg);
    padding: 20px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: var(--bg);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 20px;
    font-weight: bold;
}

.close-btn:hover {
    background-color: #8B1A1A;
}

.panel-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

/* ---------------------------------------------------------------------- */
/* ۵. استایل آیتم‌های منو و بخش‌های متنی درباره ما */
/* ---------------------------------------------------------------------- */
#menuContent {
    padding: 20px;
}

.menu-item {
    background: #ffffff0e;
    padding: 15px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-right: 4px solid var(--bg);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-weight: 700;
    font-size: 18px;
}

.item-name {
    color: var(--text);
    max-width: 70%;
}

.item-price {
    color: var(--bg);
    font-size: 20px;
    font-weight: 900;
    direction: ltr;
    font-family: Arial, sans-serif;
}

.item-desc {
    font-size: 14px;
    color: var(--desc-color);
    margin-top: 8px;
    line-height: 1.5;
    font-weight: 400;
}

.sub-category {
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 22px;
    color: var(--text);
    border-bottom: 3px solid var(--bg);
    padding-bottom: 8px;
    font-weight: 700;
}

.about-section {
    padding: 20px;
    margin: 20px 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.about-section h3 {
    color: var(--bg);
    border-bottom: 2px dashed #ddd;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 0;
}

/* ---------------------------------------------------------------------- */
/* ۶. استایل نمایش مستقیم نقشه در درباره ما و فوتر جدید */
/* ---------------------------------------------------------------------- */
.map-section-direct {
    padding: 20px;
    margin: 20px 30px;
    background: #ffffff5b;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.map-section-direct h3 {
    color: var(--bg);
    border-bottom: 2px dashed #ddd;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 0;
    text-align: center;
}

.map-container-direct {
    width: 100%;
    height: 350px; 
    margin: 15px 0;
    border: 3px solid var(--bg);
    border-radius: 8px;
    overflow: hidden;
}

.map-container-direct iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- استایل‌های فوتر جدید --- */
.app-footer {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
    background-color: var(--bg);
    text-align: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: center;
    gap: 30px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0; 
}

.footer-icon-container a {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px; 
    padding: 10px;
    transition: color 0.3s, transform 0.3s;
}

.footer-icon-container a:hover {
    color: #f0f0f0;
    transform: scale(1.1);
}

/* ---------------------------------------------------------------------- */
/* ۷. استایل‌های جزئی و رسپانسیو */
/* ---------------------------------------------------------------------- */
.boardgame-intro {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.6;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.boardgame-list {
    list-style-type: '🎲 ';
    padding-right: 20px;
    line-height: 1.8;
    font-weight: 500;
    margin-top: 15px;
    font-size: 16px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.calendar-table th, .calendar-table td {
    padding: 8px 5px;
    border: 1px solid #f0f0f0;
    text-align: center;
    font-weight: 500;
}

.calendar-table th {
    background-color: var(--bg);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.calendar-table td.today {
    background-color: var(--cal-today-bg);
    font-weight: 700;
    border: 2px solid var(--bg);
    border-radius: 5px; 
}

.calendar-table td.today .day-name {
    color: var(--bg);
}

.calendar-table td.working-hours {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    padding-top: 3px;
    direction: ltr; 
}

@media (max-width: 480px) {
    .header-logo-container {
        height: 180px; 
    }

    header img {
        width: 60px;
        height: 60px;
    }
    
    /* بهینه‌سازی اندازه فونت برای جلوگیری از بهم‌ریختگی در موبایل */
    .header-title {
        font-size: 20px; 
    }
    
    .intro-text {
        font-size: 15px; 
    }
    
    .main-button {
        padding: 12px 20px;
        font-size: 16px; 
    }
    
    .category-item {
        padding: 15px 20px;
        font-size: 17px; 
    }
    
    #menuPanel, #aboutPanel {
        max-width: 100%;
    }
    
    .map-container-direct {
        height: 250px; 
    }
    
    .calendar-table th, .calendar-table td {
        padding: 6px 3px;
        font-size: 12px;
    }
    
    .calendar-table td.working-hours {
        font-size: 10px;
    }
    
    .app-footer {
        border-radius: 0;
    }
    
    /* بهینه‌سازی اسلایدشو برای موبایل */
    .js-carousel-container,
    .carousel-track,
    .slide {
        min-height: 180px;
    }
    
    .slide img {
        min-height: 180px;
    }
}