/* ============================================
   Layer2.css - استایل Landing و 404 لایه دوم
   نسخه: 5.0.0 (MIUI Fix)
   مسیر: /L2/css/Layer2.css
   تغییرات:
   - استفاده از auto-fit به جای media query
   - رفع مشکل نمایش ۱ ستونه در گوشی‌های شیائومی
   ============================================ */

/* ============================================
   Landing Page
   ============================================ */
.l2-landing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    min-height: 100vh;
    background: #f4f6f8;
    box-sizing: border-box;
}

.l2-landing-header {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #0f1a24 0%, #1a2a3a 100%);
    color: #fff;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(15, 26, 36, 0.25);
    position: relative;
    overflow: hidden;
}

.l2-landing-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 168, 71, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.l2-landing-brand {
    text-align: right;
    margin-bottom: 1rem;
}

.l2-brand-link {
    color: #d4a847;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background: rgba(212, 168, 71, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-block;
}

.l2-brand-link:hover {
    background: rgba(212, 168, 71, 0.25);
    transform: translateX(-3px);
}

.l2-landing-header h1 {
    font-size: 1.9rem;
    margin: 0 0 0.85rem;
    color: #d4a847;
    font-weight: 800;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.l2-landing-header p {
    margin: 0 auto;
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.9;
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.l2-landing-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.l2-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    background: rgba(212, 168, 71, 0.1);
    border: 1px solid rgba(212, 168, 71, 0.25);
    border-radius: 12px;
    min-width: 100px;
}

.l2-stat strong {
    font-size: 1.6rem;
    color: #d4a847;
    font-weight: 800;
    line-height: 1;
}

.l2-stat small {
    font-size: 0.75rem;
    color: #c8d6e5;
    opacity: 0.85;
}

/* ============================================
   لیست شهرها - گرید ریسپانسیو (بدون Media Query)
   ⭐ auto-fit + minmax خودش تصمیم می‌گیره
   ============================================ */
.l2-landing-cities {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(15, 26, 36, 0.06);
    /* ⭐ مهم: جلوگیری از سرریز در MIUI */
    overflow: hidden;
    box-sizing: border-box;
}

.l2-landing-cities h2 {
    color: #1a2a3a;
    border-bottom: 3px solid #d4a847;
    padding-bottom: 0.65rem;
    margin: 0 0 1.5rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.l2-landing-cities ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* 
     * ⭐ راه‌حل MIUI:
     * auto-fit + minmax(140px, 1fr)
     * - مرورگر خودش تصمیم می‌گیره چند ستون لازمه
     * - در موبایل باریک: ۲ ستون (۱۴۰px × ۲ = ۲۸۰px)
     * - در موبایل پهن: ۲-۳ ستون
     * - در تبلت: ۳-۴ ستون
     * - در دسکتاپ: ۴-۶ ستون
     * - بدون نیاز به media query
     */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.l2-landing-cities li {
    /* ⭐ مهم: جلوگیری از سرریز آیتم‌ها در grid */
    min-width: 0;
    box-sizing: border-box;
}

.l2-landing-cities li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.8rem 0.85rem;
    background: #f9fafb;
    border: 1.5px solid #e0e6ed;
    border-radius: 10px;
    color: #1a2a3a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    min-height: 56px;
    box-sizing: border-box;
    /* ⭐ مهم: جلوگیری از سرریز متن */
    min-width: 0;
}

.l2-landing-cities li a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #d4a847;
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.l2-landing-cities li a:hover {
    background: rgba(212, 168, 71, 0.08);
    border-color: #d4a847;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 26, 36, 0.08);
    color: #0f1a24;
}

.l2-landing-cities li a:hover::before {
    transform: scaleY(1);
}

.l2-landing-cities li a .city-name {
    flex: 1 1 auto;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.l2-landing-cities li a .city-province {
    color: #888;
    font-weight: 400;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* ===== فوتر Landing ===== */
.l2-landing-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    color: #6b7a8c;
    font-size: 0.85rem;
}

.l2-landing-footer p {
    margin: 0;
}

/* ============================================
   404 Error Page
   ============================================ */
.l2-error {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    background: #f4f6f8;
}

.l2-error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: l2-bounce 2s ease-in-out infinite;
}

@keyframes l2-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.l2-error h1 {
    font-size: 6rem;
    color: #d4a847;
    margin: 0;
    line-height: 1;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(212, 168, 71, 0.3);
}

.l2-error p {
    font-size: 1.2rem;
    color: #1a2a3a;
    margin: 1rem 0 0.5rem;
    font-weight: 700;
}

.l2-error-hint {
    font-size: 0.95rem !important;
    color: #6b7a8c !important;
    font-weight: 400 !important;
    margin-bottom: 2rem !important;
    max-width: 400px;
    line-height: 1.8;
}

.l2-error-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.l2-error-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.l2-error-btn-primary {
    background: #d4a847;
    color: #0f1a24;
}

.l2-error-btn-primary:hover {
    background: #f5d98a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 71, 0.4);
}

.l2-error-btn-secondary {
    background: transparent;
    color: #1a2a3a;
    border-color: #1a2a3a;
}

.l2-error-btn-secondary:hover {
    background: #1a2a3a;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE - فقط اندازه‌های کوچیک
   ⚠️ حداقل media query برای جلوگیری از باگ MIUI
   ============================================ */

/* ===== موبایل کوچک: کاهش padding و font ===== */
@media (max-width: 480px) {
    .l2-landing {
        padding: 0.75rem;
    }

    .l2-landing-header {
        padding: 1.5rem 1rem;
        border-radius: 14px;
        margin-bottom: 1rem;
    }

    .l2-landing-header h1 {
        font-size: 1.2rem;
    }

    .l2-landing-header p {
        font-size: 0.82rem;
        line-height: 1.7;
    }

    .l2-landing-stats {
        gap: 0.4rem;
        margin-top: 1rem;
    }

    .l2-stat {
        padding: 0.45rem 0.7rem;
        min-width: 65px;
        border-radius: 10px;
    }

    .l2-stat strong {
        font-size: 1.1rem;
    }

    .l2-stat small {
        font-size: 0.6rem;
    }

    .l2-landing-cities {
        padding: 1rem 0.65rem;
        border-radius: 12px;
    }

    .l2-landing-cities h2 {
        font-size: 0.95rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.5rem;
    }

    /* ⭐ در موبایل خیلی باریک: minmax کوچیک‌تر → ۲ ستون */
    .l2-landing-cities ul {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .l2-landing-cities li a {
        padding: 0.65rem 0.6rem;
        font-size: 0.82rem;
        min-height: 52px;
        gap: 0.25rem;
    }

    .l2-landing-cities li a .city-name {
        font-size: 0.82rem;
    }

    .l2-landing-cities li a .city-province {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .l2-error h1 { font-size: 4rem; }
    .l2-error p { font-size: 1rem; }
    .l2-error-icon { font-size: 3rem; }
}

/* ===== موبایل خیلی کوچک (زیر ۳۲۰px) ===== */
@media (max-width: 320px) {
    .l2-landing {
        padding: 0.5rem;
    }

    .l2-landing-header h1 {
        font-size: 1rem;
    }

    .l2-landing-cities {
        padding: 0.85rem 0.5rem;
    }

    /* ⭐ در این حالت: ۱ ستون چون ۲ ستون خیلی باریک می‌شه */
    .l2-landing-cities ul {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}

/* ============================================
   کاهش انیمیشن
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .l2-error-icon {
        animation: none;
    }

    .l2-landing-cities li a:hover,
    .l2-error-btn:hover {
        transform: none;
    }
}