﻿:root {
    --primary: #3f51b5;
    --primary-dark: #303f9f;
    --accent: #ff4081;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --success: #4caf50;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
}

[data-theme="dark"] {
    --primary: #5c6bc0;
    --primary-dark: #3949ab;
    --accent: #f48fb1;
    --bg: #121212;
    --surface: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border: #333333;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Vazir-FD, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 100%;
    padding: 0 12px;
    margin: 0 auto;
}

/* هدر - یکپارچه شده */
header {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    color: inherit;
}
    .logo:hover {
        color: black; /* می‌تونی تغییر بدی */
    }
.logo-icon {
    width: 32px;
    height: 32px;
/*    background: rgba(255,255,255,0.2);
*/    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions {
    display: flex;
    gap: 16px;
    position: relative;
}

.header-action {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

    .header-action:hover {
        background: rgba(255,255,255,0.1);
    }

.notification-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* منوی کاربر */
.user-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 220px;
    z-index: 102;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

    .user-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
}

    .user-menu-item:last-child {
        border-bottom: none;
    }

    .user-menu-item:hover {
        background-color: rgba(0,0,0,0.05);
    }

    .user-menu-item .icon {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }

/* نوار جستجو */
.search-bar {
    padding: 8px 0 12px;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    outline: none;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-btn {
    background: var(--primary-dark);
    border: none;
    color: white;
    padding: 0 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .search-btn:hover {
        background: var(--primary);
    }

/* دسته‌بندی‌های سریع - بهبود یافته برای موبایل */
.quick-categories {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    overflow-x: auto;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* برای فایرفاکس */
}

    .quick-categories::-webkit-scrollbar {
        display: none; /* برای کروم و سافاری */
    }

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    cursor: pointer;
    transition: transform 0.3s;
    flex-shrink: 0;
}

    .category-item:hover {
        transform: translateY(-5px);
    }

.category-icon {
    width: 56px;
    height: 56px;
    background: var(--surface);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.category-item:hover .category-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.category-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* اسلایدر */
/*.slider {
    margin: 8px 0 20px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.slide {
    height: 160px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    padding: 0 20px;
}*/

/* بخش‌های اصلی */
.section {
    background: var(--surface);
    margin: 20px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .section-header {
    background: rgba(255,255,255,0.03);
}

.section-title {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title::before {
        content: "";
        width: 4px;
        height: 18px;
        background: var(--primary);
        border-radius: 2px;
    }

.section-more {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s;
}

    .section-more:hover {
        gap: 8px;
    }

/* کارت‌های محصول - طراحی جدید و جذاب و باریک‌تر */
.products-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    padding: 16px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
    position: relative;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-hover);
    }

    .product-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .product-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .product-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .product-card:nth-child(4) {
        animation-delay: 0.4s;
    }

.product-image {
    height: 140px;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .product-image {
    background: linear-gradient(135deg, #333, #555);
}

.product-image::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: linear-gradient(to top, var(--surface), transparent);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.product-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    z-index: 1;
}

.product-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: bold;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem;
}

.product-price {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .product-price::before {
        content: "💰";
        font-size: 0.9rem;
    }

.progress-container {
    margin-bottom: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-participate {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .btn-participate:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
    }

.btn-favorite {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

    .btn-favorite:hover {
        color: var(--accent);
        border-color: var(--accent);
    }

/* آمار - بهبود یافته برای موبایل */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px 6px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    border: 1px solid var(--border);
}

    .stat-item:hover {
        transform: translateY(-5px);
    }

.stat-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ناوبری پایین - فقط برای موبایل */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s;
}

    .nav-item.active {
        color: var(--primary);
        background: rgba(63, 81, 181, 0.1);
    }

.nav-icon {
    font-size: 1.3rem;
}

/* دکمه شناور */
.fab {
    position: fixed;
    bottom: 70px;
    left: 16px;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

    .fab:hover {
        transform: scale(1.1) rotate(90deg);
        box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    }

/* شمارش معکوس برای قرعه‌کشی */
.countdown {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 12px 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.1);
    color: var(--text-primary);
    padding: 6px 4px;
    border-radius: 6px;
    min-width: 36px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .countdown-item {
    background: rgba(255,255,255,0.1);
}

.countdown-value {
    font-weight: bold;
    font-size: 1rem;
}

.countdown-label {
    font-size: 0.6rem;
    margin-top: 2px;
}

.countdown-ended {
    background: var(--accent);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
}

/* پنل اعلانات - بهبود یافته */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--surface);
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 101;
    transition: right 0.3s;
    overflow-y: auto;
}

    .notifications-panel.active {
        right: 0;
    }

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

    .notification-item:hover {
        background-color: rgba(0,0,0,0.03);
    }

.notification-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.notification-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.notifications-title {
    font-weight: bold;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
}

/* 🎯 پایه عمومی */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding-top: 5vh;
    padding-bottom: 5vh;
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10000;
    opacity: 1;
    display: block;
    max-height: calc(var(--vh, 1vh) * 90);
}

/* ✳️ نمایش فعال */
.modal-overlay.active .modal {
    transform: translateY(0);
}

/* 📱 حالت موبایل (پایه) */
.modal {
    width: 90%;
    max-width: 90%;
    max-height: calc(var(--vh, 1vh) * 55);
}

    .modal.grow {
        max-height: calc(var(--vh, 1vh) * 70);
    }

    .modal.grow-large {
        max-height: calc(var(--vh, 1vh) * 85);
    }

/* 💻 حالت تبلت و دسکتاپ (≥ 576px) */
@media (min-width: 576px) {
    .modal {
        width: 90%;
        max-width: 400px;
        max-height: calc(var(--vh, 1vh) * 55);
    }

        .modal.grow {
            max-height: calc(var(--vh, 1vh) * 70);
        }

        .modal.grow-large {
            max-height: calc(var(--vh, 1vh) * 85);
        }
}

/* 🖥️ دسکتاپ بزرگ (≥ 992px) */
@media (min-width: 992px) {

    .modal {
        width: 90%;
        max-width: 400px;
        max-height: calc(var(--vh, 1vh) * 55);
        max-width: 420px;
    }

        .modal.grow {
            max-height: calc(var(--vh, 1vh) * 70);
        }

        .modal.grow-large {
            max-height: calc(var(--vh, 1vh) * 85);
        }
}

/* 📲 حالت ویژه برای موبایل کوچک (≤ 575px) */
@media (max-width: 575px) {
    .modal {
        max-height: calc(var(--vh, 1vh) * 65) !important;
        max-height: 65dvh !important;
    }

        .modal.grow {
            max-height: calc(var(--vh, 1vh) * 80) !important;
            max-height: 80dvh !important;
        }

        .modal.grow-large {
            max-height: calc(var(--vh, 1vh) * 90) !important;
            max-height: 90dvh !important;
        }
}





.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}




.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .form-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.2);
    }

/*.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: background-color 0.3s, transform 0.2s;
}

    .btn:active {
        transform: scale(0.98);
    }

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

    .btn-secondary:hover {
        background: rgba(0,0,0,0.05);
    }*/

/* فرم احراز هویت بهبود یافته */
.auth-step {
    display: none;
}

    .auth-step.active {
        display: block;
        animation: fadeIn 0.4s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.success-message {
    color: var(--success);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

    .back-button:hover {
        color: var(--primary-dark);
    }

/* محافظت از محتوا */
.protected-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    position: relative;
}

.login-prompt {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    z-index: 10;
    width: 80%;
}

/* انیمیشن‌های اضافی */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countdownChange {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.countdown-changing {
    animation: countdownChange 0.5s ease;
}

/* استایل‌های اضافی برای بخش قرعه‌کشی‌های فعال */
.lottery-card-featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

    .lottery-card-featured .product-image {
        background: rgba(255,255,255,0.1);
    }

    .lottery-card-featured .product-title,
    .lottery-card-featured .product-price,
    .lottery-card-featured .progress-info,
    .lottery-card-featured .product-meta {
        color: white;
    }

    .lottery-card-featured .progress-bar {
        background: rgba(255,255,255,0.2);
    }

    .lottery-card-featured .btn-participate {
        background: white;
        color: var(--primary);
    }

        .lottery-card-featured .btn-participate:hover {
            background: rgba(255,255,255,0.9);
        }

    .lottery-card-featured .btn-favorite {
        border-color: rgba(255,255,255,0.3);
        color: white;
    }

        .lottery-card-featured .btn-favorite:hover {
            border-color: white;
            color: white;
        }

    .lottery-card-featured .countdown-item {
        background: rgba(255,255,255,0.2);
        color: white;
    }

/* استایل‌های جدید برای بخش آگهی‌ها (شبیه دیوار) */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.ad-card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

    .ad-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

.ad-image {
    height: 120px;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

[data-theme="dark"] .ad-image {
    background: linear-gradient(135deg, #333, #555);
}

.ad-badge {
    position: absolute;
    top: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 3px 7px;
    font-size: 0.75rem;
    border-radius: 6px;
    z-index: 5;
}

    .ad-badge.source {
        right: 6px;
        background: rgba(41, 29, 206, 0.75);
    }

    .ad-badge.type {
        left: 6px;
        background: rgba(255, 0, 90, 0.75);
    }

  a{
      text-decoration:none;
  }
.ad-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-title {
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4rem;
}

.ad-price {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.ad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* استایل‌های جدید برای بخش برندگان */
.winners-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    padding: 16px;
}

.winner-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

    .winner-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

    .winner-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(to bottom, var(--accent), var(--primary));
    }

.winner-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.winner-info {
    flex: 1;
}

.winner-name {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 1rem;
}

.winner-prize {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.winner-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.winner-badge {
    background: linear-gradient(135deg, var(--accent), #ff6b9c);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.winner-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* فوتر - یکپارچه شده */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding: 30px 0 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .footer-link:hover {
        color: var(--primary);
    }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

    .social-link:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-3px);
    }

/* ========== MEDIA QUERIES ========== */

/* موبایل - صفحه‌های کوچک (480px به بالا) */
@media (min-width: 480px) {
    .container {
        max-width: 480px;
    }

    .stats {
        gap: 12px;
        padding: 16px;
    }

    .stat-item {
        padding: 16px 8px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .products-grid {
        padding: 18px;
    }

    .ads-grid {
        gap: 14px;
        padding: 18px;
    }

    .winners-grid {
        padding: 18px;
    }
}
@media (max-width: 767px) {
    .slide-img {
        height: 220px !important; /* ارتفاع ثابت موردنظر شما */
        object-fit: cover !important;
    }
}
/* تبلت - صفحه‌های کوچک (768px به بالا) */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 0 20px;
    }

    /* هدر و ناوبری */
    .header-top {
        padding: 16px 0;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .search-bar {
        padding: 12px 0 16px;
    }

    .search-input {
        padding: 14px 18px;
        font-size: 1rem;
    }

    /* دسته‌بندی‌ها */
    .quick-categories {
        justify-content: center;
        gap: 20px;
        padding: 20px 0;
    }

    .category-item {
        min-width: 80px;
    }

    .category-icon {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    /* اسلایدر */
    .slider {
        margin: 12px 0 24px;
    }

    .slide {
        height: 200px;
        font-size: 1.6rem;
    }

    /* آمار */
    .stats {
        gap: 16px;
        padding: 20px;
    }

    .stat-item {
        padding: 20px 12px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    /* قرعه‌کشی‌های فعال */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 24px;
    }

    .product-card {
        border-radius: 14px;
    }

    .product-image {
        height: 160px;
    }

    .product-icon {
        font-size: 3.5rem;
    }

    .product-info {
        padding: 18px;
    }

    .product-title {
        font-size: 1.05rem;
        height: 3rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .btn-participate {
        padding: 12px;
        font-size: 0.9rem;
    }

    /* آگهی‌ها */
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 20px;
    }

    .ad-card {
        border-radius: 10px;
    }

    .ad-image {
        height: 140px;
    }

    .ad-info {
        padding: 14px;
    }

    .ad-title {
        font-size: 0.9rem;
        height: 2.6rem;
    }

    .ad-price {
        font-size: 1rem;
    }

    /* برندگان */
    .winners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 20px;
    }

    .winner-card {
        padding: 18px;
        border-radius: 14px;
    }

    .winner-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.7rem;
    }

    .winner-name {
        font-size: 1.1rem;
    }

    .winner-prize {
        font-size: 0.9rem;
    }

    /* فوتر */
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }

    /* پنل اعلانات - بهبود یافته برای تبلت */
    .notifications-panel {
        width: 400px;
        right: -400px;
    }

        .notifications-panel.active {
            right: 0;
        }

    /* مدال */
    .modal {
        max-width: 450px;
        max-height: 75vh;
    }
}

/* لپ‌تاپ و دسکتاپ - صفحه‌های بزرگ (1024px به بالا) */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding: 0 24px;
    }

    /* هدر و ناوبری */
    .header-top {
        padding: 18px 0;
    }

    .logo {
        font-size: 1.4rem;
    }

    .logo-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .search-bar {
        padding: 14px 0 18px;
    }

    .search-input {
        padding: 16px 20px;
        font-size: 1.05rem;
    }

    /* دسته‌بندی‌ها */
    .quick-categories {
        gap: 24px;
        padding: 24px 0;
    }

    .category-item {
        min-width: 90px;
    }

    .category-icon {
        width: 72px;
        height: 72px;
        font-size: 1.8rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    /* اسلایدر */
    .slider {
        margin: 16px 0 28px;
    }

    .slide {
        height: 250px;
        font-size: 1.8rem;
    }

    /* آمار */
    .stats {
        gap: 20px;
        padding: 24px;
        max-width: 800px;
        margin: 0 auto;
    }

    .stat-item {
        padding: 24px 16px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 1rem;
    }

    /* قرعه‌کشی‌های فعال */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        padding: 28px;
    }

    .product-card {
        border-radius: 16px;
    }

    .product-image {
        height: 180px;
    }

    .product-icon {
        font-size: 4rem;
    }

    .product-info {
        padding: 20px;
    }

    .product-title {
        font-size: 1.1rem;
        height: 3.2rem;
    }

    .product-price {
        font-size: 1.3rem;
    }

    .btn-participate {
        padding: 14px;
        font-size: 1rem;
    }

    /* آگهی‌ها */
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 24px;
    }

    .ad-card {
        border-radius: 12px;
    }

    .ad-image {
        height: 160px;
    }

    .ad-info {
        padding: 16px;
    }

    .ad-title {
        font-size: 0.95rem;
        height: 2.8rem;
    }

    .ad-price {
        font-size: 1.05rem;
    }

    /* برندگان */
    .winners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 24px;
    }

    .winner-card {
        padding: 20px;
        border-radius: 16px;
    }

    .winner-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.9rem;
    }

    .winner-name {
        font-size: 1.2rem;
    }

    .winner-prize {
        font-size: 1rem;
    }

    /* پنل اعلانات - بهبود یافته برای دسکتاپ */
    .notifications-panel {
        width: 450px;
        right: -450px;
    }

        .notifications-panel.active {
            right: 0;
        }

    /* مدال */
    .modal {
        max-width: 400px;
        max-height: 75vh;
    }
}

/* صفحه‌های بسیار بزرگ (1400px به بالا) */
@media (min-width: 1400px) {
    .container {
        max-width: 1200px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ads-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========== بهبودهای خاص برای لپ‌تاپ و تبلت ========== */

/* مخفی کردن ناوبری پایین در تبلت و دسکتاپ */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }

    .fab {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

/* بهبود پنل اعلانات برای تبلت و دسکتاپ */
@media (min-width: 768px) {
    .notifications-panel {
        width: 400px;
        right: -400px;
        box-shadow: -4px 0 16px rgba(0,0,0,0.15);
    }

        .notifications-panel.active {
            right: 0;
        }
}

@media (min-width: 1024px) {
    .notifications-panel {
        width: 450px;
        right: -450px;
    }

        .notifications-panel.active {
            right: 0;
        }
}

/* بهبود منوی کاربر برای تبلت و دسکتاپ */
@media (min-width: 768px) {
    .user-menu {
        width: 240px;
    }
}

@media (min-width: 1024px) {
    .user-menu {
        width: 260px;
    }
}

/* بهبود طرح‌بندی‌های محتوا برای تبلت و دسکتاپ */
@media (min-width: 768px) {
    .section {
        margin: 24px 0;
    }
}

@media (min-width: 1024px) {
    .section {
        margin: 32px 0;
    }
}

.section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.section-more {
    font-size: 0.9rem;
    color: #3f51b5;
    text-decoration: none;
}

/* کارت ویژه */
.featured-lottery {
    margin: 1rem;
}

.lottery-card-featured {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(90deg, #3949ab 0%, #5c6bc0 100%);
    color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

    .lottery-card-featured img {
        width: 100%;
        max-width: 480px;
        height: auto;
        object-fit: cover;
        border-radius: 0;
    }

.lottery-info {
    flex: 1;
    padding: 1.5rem;
}

    .lottery-info h3 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
    }

    .lottery-info .price {
        font-size: 1.2rem;
        color: #ffeb3b;
        font-weight: 600;
    }

.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #ffeb3b;
}

.btn-join {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: white;
    color: #3f51b5;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-join:hover {
        background: #f5f5f5;
    }

/* کارت‌های کوچکتر */
.lotteries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.lottery-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

    .lottery-card:hover {
        transform: translateY(-4px);
    }

    .lottery-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
    }

.lottery-body {
    padding: 0.8rem 1rem;
    text-align: center;
}

.lottery-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lottery-price {
    color: #3949ab;
    font-size: 0.9rem;
   
}

.btn-small {
    background: #3949ab;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
}

    .btn-small:hover {
        background: #303f9f;
    }
.lotteries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem;
}

/* در دسکتاپ دقیقا ۴ تا در ردیف */
@media (min-width: 992px) {
    .lotteries-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.lottery-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

    .lottery-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    }

.lottery-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.lottery-body {
    padding: 0.8rem 1rem 1rem;
    text-align: center;
}

.lottery-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
}

.lottery-price {
    font-size: 0.9rem;
    color: #3949ab;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.progress-bar {
    background-color: #eee;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3949ab;
    border-radius: 3px;
}

.btn-small {
    background-color: #3949ab;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 1.2rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-small:hover {
        background-color: #2c387e;
    }

/* 🎟️ کارت ویژه قرعه‌کشی */
.lottery-card-featured {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .lottery-card-featured:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }

    /* 📸 تصویر قرعه‌کشی */
    .lottery-card-featured .lottery-image {
        flex: 0 0 25%;
        position: relative;
    }

        .lottery-card-featured .lottery-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

    /* 🧾 اطلاعات قرعه‌کشی */
    .lottery-card-featured .lottery-info {
        flex: 1;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .lottery-card-featured h3 {
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 0.6rem;
        color: #fff;
    }

    .lottery-card-featured .price {
        font-size: 1.1rem;
        font-weight: 600;
        color: #ffeb3b;
        margin-bottom: 1rem;
    }

    /* 🔵 نوار پیشرفت */
    .lottery-card-featured .progress-container {
        margin: 0.8rem 0 1rem;
    }

    .lottery-card-featured .progress-bar {
        background: rgba(255, 255, 255, 0.3);
        height: 6px;
        border-radius: 10px;
        overflow: hidden;
    }

    .lottery-card-featured .progress-fill {
        background: #fff;
        height: 6px;
        width: 0;
        border-radius: 10px;
        transition: width 0.5s ease;
    }

    .lottery-card-featured .progress-text {
        font-size: 0.9rem;
        margin-top: 6px;
    }

    /* 📅 اطلاعات شروع و پایان */
    .lottery-card-featured .lottery-meta {
        font-size: 0.85rem;
        opacity: 0.9;
        flex-direction: column;
        gap: 4px;
    }

    /* 🟡 دکمه شرکت */
    .lottery-card-featured .btn-join {
        background: #ffeb3b;
        color: var(--primary-dark);
        border: none;
        border-radius: 8px;
        padding: 10px 22px;
        font-weight: 600;
        cursor: pointer;
        align-self: flex-start;
        transition: 0.3s;
        margin-top: 1rem;
    }

        .lottery-card-featured .btn-join:hover {
            background: #fff;
            color: var(--primary-dark);
        }

/* 🌙 حالت تیره */
[data-theme="dark"] .lottery-card-featured {
    background: linear-gradient(90deg, #2f3dbf, #4e5eea);
    color: #fff;
}

/* 📱 موبایل */
@media (max-width: 768px) {
    .lottery-card-featured {
        flex-direction: column; /* تصویر بالا */
        text-align: center;
    }

        .lottery-card-featured .lottery-image {
            flex: none;
            width: 100%;
            height: 220px;
        }

        .lottery-card-featured .lottery-info {
            padding: 1rem;
            align-items: center;
        }

        .lottery-card-featured .btn-join {
            align-self: center;
        }
}
/* 🌐 بهبود نمایش نوار پیشرفت در موبایل */
@media (max-width: 768px) {
    .lottery-card-featured .progress-bar {
        height: 10px; /* ضخیم‌تر و قابل‌مشاهده‌تر */
        border-radius: 6px;
    }

    .lottery-card-featured .progress-fill {
        height: 10px;
    }

    .lottery-card-featured .progress-text {
        font-size: 1rem; /* متن خواناتر */
        margin-top: 8px;
    }

    .lottery-card-featured .price {
        font-size: 1.25rem; /* قیمت کمی بزرگ‌تر برای تعادل بصری */
    }
}

/* استایل منوی اصلی */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

    .nav-item:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-2px);
    }

    .nav-item.active {
        background: var(--primary);
        color: white;
        box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
    }

.nav-login {
    background: var(--accent);
    color: white;
    margin-right: 10px;
}

    .nav-login:hover {
        background: var(--accent-dark);
        transform: translateY(-2px);
    }

.nav-icon {
    font-size: 1.1rem;
}

/* استایل منوی موبایل */
#mobileMenuToggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
}

.menu-bar {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    box-shadow: -2px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 9999;
    padding-top: 5px;
}

    .mobile-menu.active {
        right: 0;
    }

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        background: var(--primary);
        color: white;
    }

.mobile-nav-login {
    background: var(--accent);
    color: white;
    margin-top: 10px;
}

    .mobile-nav-login:hover {
        background: var(--accent-dark);
    }

.btn-login-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* overlay برای منوی موبایل */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9990;
    display: none;
}

    .mobile-menu-overlay.active {
        display: block;
    }

/* ریسپانسیو */
@media (max-width: 992px) {
    .main-nav {
        gap: 4px;
        margin: 0 10px;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .header-top {
        position: relative;
    }

    .mobile-menu {
        width: 250px;
    }
}

/* انیمیشن برای منوی همبرگری */
#mobileMenuToggle.active .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

#mobileMenuToggle.active .menu-bar:nth-child(2) {
    opacity: 0;
}

#mobileMenuToggle.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}



/* اوورلی تمام‌صفحه */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 9980;
}

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* منوی موبایل: بیرون از header و روی همه چیز */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface, #fff);
    box-shadow: -2px 0 20px rgba(0,0,0,0.2);
    transition: right .3s ease;
    z-index: 9999;
    padding-top: 5px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none; /* وقتی بسته است کلیک‌ناپذیر */
}

    .mobile-menu.active {
        right: 0;
        pointer-events: auto; /* وقتی باز شد کلیک‌پذیر */
    }

    /* برای اطمینان: لینک‌ها بالاترین لایه داخل منو باشند */
    .mobile-menu .mobile-nav-item {
        position: relative;
        z-index: 1;
    }

/* اگر هدر z-index بالایی دارد، پایین‌تر از منو بماند */
header.header, header {
    position: relative;
    z-index: 100; /* منو 9999 است */
}


/* ✅ Override برای موتورهای WebKit/Blink در موبایل */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
    }
    /* overlay تمام قدِ viewport واقعی */
    #authModal.modal-overlay {
        height: -webkit-fill-available !important;
        align-items: flex-start !important; /* از بالا رشد کنه */
        overflow-y: auto !important; /* اسکرول داشته باشه */
        padding-top: 5%;
        padding-bottom: 5%;
    }
    /* مدال به‌جای vh از درصد والد استفاده می‌کند */
    #authModal .modal {
        max-height: 90% !important; /* ≈ 90% از ارتفاع overlay */
    }

        #authModal .modal.grow {
            max-height: 95% !important;
        }

        #authModal .modal.grow-large {
            max-height: 100% !important; /* اگر خواستی فولِ ارتفاع والد */
        }
}



.winners-swiper {
    padding-bottom: 40px !important;
}

.winners-swiper .swiper-slide {
    display: flex;
    flex-direction: column;
    gap: 15px; /* فاصله بین دو کارت در موبایل */
}

.winners-swiper .swiper-pagination {
    position: absolute;
    bottom: 0;
    text-align: center;
    width: 100%;
}

.winners-swiper .swiper-pagination-bullet {
    background: #ccc;
    opacity: 0.6;
}

.winners-swiper .swiper-pagination-bullet-active {
    background: linear-gradient(45deg, #7b2ff7, #00c6ff);
    opacity: 1;
}

.ads-swiper {
    padding-bottom: 40px !important;
}

    .ads-swiper .swiper-pagination {
        position: absolute;
        bottom: 0;
        text-align: center;
        width: 100%;
    }

    .ads-swiper .swiper-pagination-bullet {
        background: #bbb;
        opacity: 0.6;
        margin: 0 3px;
    }

    .ads-swiper .swiper-pagination-bullet-active {
        background: linear-gradient(45deg, #7b2ff7, #00c6ff);
        opacity: 1;
    }



#phoneInput,
#passwordInput,
#registerPassword,
#confirmPassword {
    direction: ltr;
    text-align: left;
    font-family: monospace, tahoma;
    font-weight:800;
}





.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    padding: 15px;
}

    .popup-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.popup-container {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transform: scale(0.7) translateY(50px);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.popup-overlay.active .popup-container {
    transform: scale(1) translateY(0);
}

.popup-header {
   background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    padding: 20px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

    .popup-header::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
        transform: rotate(30deg);
    }

    .popup-header h2 {
        font-size: 1.6rem;
        margin-bottom: 8px;
        text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        position: relative;
    }

    .popup-header p {
        font-size: 1.2rem;
        opacity: 0.9;
        position: relative;
        text-align:right;
    }

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg) scale(1.1);
    }

.popup-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #fafafa; /* رنگ پایه خیلی روشن */
    border-radius: 16px;
    transition: background-color 0.6s ease, box-shadow 0.8s ease;
}

.audio-section {
    background: rgba(106, 17, 203, 0.05);
    border-radius: 15px;
    padding: 18px;
    border: 1px solid rgba(106, 17, 203, 0.1);
    order: 1;
    flex-shrink: 0;
}

    .audio-section h4 {
        font-size: 1.2rem;
        margin-bottom: 12px;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: center;
        justify-content: center;
    }

        .audio-section h4 i {
            color: var(--accent);
        }

.audio-player {
    width: 100%;
    height: 45px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
}

.popup-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s ease;
    position: relative;
    order: 2;
    flex-shrink: 0;
}

    .popup-image img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        display: block;
        transition: transform 0.5s ease;
    }

    .popup-image:hover img {
        transform: scale(1.05);
    }

.popup-text {
    padding: 0;
    order: 3;
}

    .popup-text h3 {
        font-size: 1.4rem;
        margin-bottom: 12px;
        color: var(--primary);
        position: relative;
        display: inline-block;
        text-align: center;
        width: 100%;
    }

        .popup-text h3::after {
            content: '';
            position: absolute;
            bottom: -5px;
            right: 50%;
            transform: translateX(50%);
            width: 50px;
            height: 3px;
            background: linear-gradient(to right, var(--accent), var(--primary));
            border-radius: 3px;
        }

    .popup-text p {
        margin-bottom: 15px;
        line-height: 1.7;
        color: #555;
        text-align: justify;
        font-size: 0.9rem;
    }

.features-list {
    list-style: none;
    margin: 15px 0;
}

    .features-list li {
        margin-bottom: 10px;
        padding-right: 28px;
        position: relative;
        font-size: 0.85rem;
    }

        .features-list li::before {
            content: '✓';
            position: absolute;
            right: 0;
            top: 0;
            width: 20px;
            height: 20px;
            background: var(--success);
            color: white;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 0.7rem;
        }

.faq-section {
    order: 4;
    margin-top: 10px;
}

.faq-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.faq-item {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

.faq-question {
    background: rgba(106, 17, 203, 0.05);
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .faq-question:hover {
        background: rgba(106, 17, 203, 0.1);
    }

    .faq-question i {
        transition: transform 0.3s ease;
    }

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    line-height: 1.6;
    color: #555;
}

.faq-item.active .faq-answer {
    padding: 15px;
    max-height: 350px;
    min-height: 380px;
    overflow-y:auto

}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    order: 5;
    flex-shrink: 0;
}


.show-popup-btn {
    position: fixed;
    bottom: 77px;
    left: 20px;
    background: #ffc953;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 5px 20px rgba(255, 193, 7, 0.5);
    z-index: 100;
    transition: all 0.3s ease;
    animation: blink-glow 2s infinite, float 3s ease-in-out infinite;
}

    .show-popup-btn:hover {
        transform: scale(1.1) rotate(15deg);
        box-shadow: 0 8px 25px rgba(255, 193, 7, 0.7);
        animation: none;
    }

@keyframes blink-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 193, 7, 0.9), 0 0 35px rgba(255, 193, 7, 0.6);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite linear;
}

    .floating-element:nth-child(1) {
        width: 50px;
        height: 50px;
        top: 10%;
        left: 10%;
        animation-duration: 20s;
    }

    .floating-element:nth-child(2) {
        width: 70px;
        height: 70px;
        top: 60%;
        left: 80%;
        animation-duration: 25s;
        animation-delay: 2s;
    }

@media (min-width: 768px) {
    .popup-container {
        max-width: 700px;
        max-height: 80vh;
    }

    .popup-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .audio-section {
        grid-column: 1 / -1;
        order: 1;
    }

    .popup-image {
        order: 2;
        height: 100%;
    }

        .popup-image img {
            height: 220px;
        }

    .popup-text {
        order: 3;
    }

    .faq-section {
        grid-column: 1 / -1;
        order: 4;
    }

    .popup-buttons {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
        order: 5;
    }

    /*.btn {
        padding: 14px 25px;
    }*/

    .popup-header {
        padding: 25px;
    }

        .popup-header h2 {
            font-size: 1.8rem;
        }
}

@media (max-width: 380px) {
    .popup-header {
        padding: 18px 15px;
    }

        .popup-header h2 {
            font-size: 1.4rem;
        }

    .popup-content {
        padding: 15px;
        gap: 15px;
    }

    .audio-section, .popup-text {
        padding: 15px;
    }

    .popup-image img {
        height: 160px;
    }

    .popup-text h3 {
        font-size: 1.3rem;
    }

    .show-popup-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

    .popup-content::-webkit-scrollbar-thumb:hover {
        background: var(--secondary);
    }

.scroll-indicator {
    text-align: center;
    color: #888;
    font-size: 0.8rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

    .scroll-indicator i {
        animation: bounce 2s infinite;
    }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

.guide-popup {
    position: fixed;
    bottom: 150px;
    left: 20px;
    background: white;
    border-radius: 15px;
    padding: 12px 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 99;
    max-width: 200px;
    font-size: 0.85rem;
    color: var(--dark);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-right: 4px solid var(--warning);
}

    .guide-popup::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 20px;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid white;
    }

    .guide-popup.show {
        opacity: 1;
        transform: translateY(0);
    }


.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg) scale(1.1);
    }

#box-widget-icon{
    bottom:55px !important;
}

@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }

    .alert-custom {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        text-align:justify;
    }
    .section {
        margin: 2rem 0 !important;
    }
}


.alert-custom {
    position: relative;
    border-radius: 14px;
    padding: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    text-align: right;
    box-shadow: 0 0 14px rgba(111, 66, 193, 0.45);
    overflow: hidden;
    animation: colorFlow 6s ease-in-out infinite;
}

    /* آیکن هدیه */
    .alert-custom i {
        margin-left: 6px;
        font-size: 1rem;
        color: #ffd86b;
        animation: iconFloat 2s ease-in-out infinite;
    }

    /* موج نور از چپ به راست */
    .alert-custom::after {
        content: "";
        position: absolute;
        top: 0;
        left: -80%;
        width: 60%;
        height: 100%;
        background: linear-gradient(120deg, rgba(255,255,255,0.25), rgba(255,255,255,0));
        transform: skewX(-25deg);
        animation: shineMove 4s linear infinite;
        pointer-events: none;
    }

/* --- انیمیشن‌ها --- */

/* تغییر تدریجی رنگ گرادیان (مثل تنفس) */
@keyframes colorFlow {
    0% {
        background: linear-gradient(90deg, #6a11cb, #2575fc);
    }

    25% {
        background: linear-gradient(90deg, #2575fc, #00c6ff);
    }

    50% {
        background: linear-gradient(90deg, #00c6ff, #6a11cb);
    }

    75% {
        background: linear-gradient(90deg, #a044ff, #2575fc);
    }

    100% {
        background: linear-gradient(90deg, #6a11cb, #2575fc);
    }
}

/* تاب خوردن نرم آیکن */
@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* موج نورانی از چپ به راست */
@keyframes shineMove {
    0% {
        left: -80%;
    }

    100% {
        left: 120%;
    }
}

.popup-content.highlight {
    box-shadow: 0 0 25px 10px rgba(63, 81, 181, 0.35);
    background-color: #e8edff !important;  
}


header .notification-widget,
header .bell-container {
    all: unset; /* حذف تمام استایل‌های قبلی */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #444;
    position: static !important;
    background: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

    header .bell-container:hover i {
        color: #6a11cb !important;
        transform: scale(1.15);
    }


.bell-icon {
    color: #f4820d !important;
}


/* --- ساختار اصلی --- */
.custom-slider {
    border-radius: 18px;
    overflow: hidden;
    margin: 12px 0 24px;
    position: relative;
    background: #000;
}

.slide-img {
    object-fit: cover;
    max-height: 460px;
    transition: transform 1.2s ease, opacity 0.6s ease;
    opacity: 0.95;
}

.carousel-item.active .slide-img {
    transform: scale(1.02);
}

/* --- کپشن --- */
.custom-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 20px 30px;
    border-radius: 12px;
    max-width: 80%;
}

.slide-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.6rem;
    text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.slide-subtitle {
    color: #eee;
    font-size: 1rem;
    margin-top: 6px;
}

/* --- دکمه --- */
.slide-btn {
    background: #ffca2c;
    color: #111;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 20px;
    margin-top: 10px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

    .slide-btn:hover {
        background: #ffc107;
        transform: scale(1.05);
    }

/* --- کنترل‌ها --- */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(100%) drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

/* --- واکنش‌گرا --- */
@media (max-width: 768px) {
    .custom-caption {
        bottom: 0;
        top: auto;
        transform: none;
        background: rgba(0,0,0,0.55);
        border-radius: 0;
        padding: 14px;
        width:100%;
    }

    .slide-title {
        font-size: 1.2rem;
    }

    .slide-subtitle {
        font-size: 0.9rem;
    }

    .slide-btn {
        font-size: 0.8rem;
        padding: 4px 14px;
    }
}


@media (min-width: 992px) {
    .custom-caption {
        top: 30%;
        left: 10%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.4);
        border-radius: 14px;
        padding: 28px 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        max-width: 60%; /* ← باکس اطلاعات پهن‌تر شد */
        width: 100%;
        text-align: center;
        color: #fff;
        box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
    }

        .custom-caption h4 {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 6px;
            color: #fff;
        }

        .custom-caption p {
            font-size: 1.05rem;
            color: #f1f1f1;
            margin-bottom: 12px;
        }

        .custom-caption .slide-btn {
            background: #ffca2c;
            color: #111;
            font-weight: 600;
            border-radius: 8px;
            padding: 8px 22px;
            font-size: 0.95rem;
            transition: all 0.25s ease;
        }

            .custom-caption .slide-btn:hover {
                background: #ffc107;
                transform: translateY(-2px);
            }
}



.lottery-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    font-size: 0.9rem;
   
}

.lottery-label {
    font-size: 12px;
    color: #555;
}

.user-balance {
    font-size: 0.85rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: .35rem;
}

    .user-balance .fw-bold {
        font-weight: 700;
    }

.badge-points {
    background: #fff3cd;
    color: #b8860b;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
}


.notification-count {
    position: absolute;
    top: -8px !important;
    right: 22px !important;
}
