﻿/* 📱 ریسپانسیو حرفه‌ای برای PackList */

/* 🎯 تنظیمات پایه */
:root {
    --container-padding-mobile: 1rem;
    --container-padding-tablet: 1.5rem;
    --container-padding-desktop: 2rem;
    --section-padding-mobile: 2rem 0;
    --section-padding-desktop: 4rem 0;
    --card-border-radius: 1rem;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 🎯 رفع مشکل اسکرول افقی */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* 🎯 کانتینرهای ریسپانسیو */
.container-fluid-custom {
    width: 100%;
    padding-right: var(--container-padding-mobile);
    padding-left: var(--container-padding-mobile);
    margin-right: auto;
    margin-left: auto;
}

/* 📱 موبایل (صفحات کوچک) */
@media (max-width: 576px) {
    .container, .container-fluid {
        padding-right: 12px !important;
        padding-left: 12px !important;
    }

    /* تایپوگرافی موبایل */
    .display-1 {
        font-size: 2rem !important;
    }

    .display-2 {
        font-size: 1.8rem !important;
    }

    .display-3 {
        font-size: 1.6rem !important;
    }

    .display-4 {
        font-size: 1.4rem !important;
    }

    .display-5 {
        font-size: 1.3rem !important;
    }

    h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
    }

    h4 {
        font-size: 1.2rem !important;
    }

    h5 {
        font-size: 1.1rem !important;
    }

    h6 {
        font-size: 1rem !important;
    }

    /* کارت‌ها در موبایل */
    .card {
        margin-bottom: 1rem !important;
        border-radius: var(--card-border-radius) !important;
        box-shadow: var(--shadow-soft) !important;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    /* دکمه‌های لمسی */
    .btn {
        padding: 14px 20px !important;
        min-height: 48px !important;
        font-size: 16px !important;
        margin: 6px 0 !important;
        border-radius: 12px !important;
        width: 100% !important;
    }

    /* فرم‌ها */
    .form-control, .form-select {
        padding: 14px 16px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }

    /* جداول ریسپانسیو */
    .table-responsive {
        border-radius: 12px;
        margin: 0 -12px;
    }

        .table-responsive table {
            min-width: 600px;
        }

    /* ناوبری */
    .navbar-brand {
        font-size: 1.3rem !important;
    }

    .nav-link {
        padding: 12px 16px !important;
        font-size: 15px !important;
        text-align: right !important;
    }

    /* صفحات لاگین و ثبت‌نام */
    .login-container, .register-container {
        padding: 2rem 1rem !important;
        min-height: 100vh !important;
    }

    /* لیست‌ها */
    .lists-container {
        padding: 1.5rem 0.5rem !important;
    }

    /* گرید سیستم */
    .row {
        margin-right: -8px !important;
        margin-left: -8px !important;
    }

    .col, [class*="col-"] {
        padding-right: 8px !important;
        padding-left: 8px !important;
    }
}

/* 📱 تبلت (صفحات متوسط) */
@media (max-width: 768px) {
    .container, .container-fluid {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    /* صفحات خاص */
    .hero-section {
        padding: 3rem 0 !important;
    }

        .hero-section h1.display-3 {
            font-size: 2rem !important;
            text-align: center;
            line-height: 1.3 !important;
        }

        .hero-section .lead {
            text-align: center;
            font-size: 1.1rem !important;
        }

    /* کارت لیست‌ها */
    .list-card .btn-group {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .list-card .btn {
        width: 100% !important;
        margin: 2px 0 !important;
    }

    /* آیتم‌های لیست */
    .list-item {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }

    /* پیشرفت‌بار */
    .progress {
        height: 10px !important;
        border-radius: 8px !important;
    }

    /* مودال */
    .modal-dialog {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }

    .modal-content {
        border-radius: 16px !important;
    }

    /* جداول */
    table {
        font-size: 14px !important;
    }

    /* فاصله‌های بهینه */
    .section-py {
        padding: 2.5rem 0 !important;
    }

    .mb-desktop {
        margin-bottom: 1.5rem !important;
    }
}

/* 📱 تبلت بزرگ */
@media (max-width: 992px) {
    /* تنظیمات کارت‌های بزرگ */
    .card-hover:hover {
        transform: translateY(-5px) !important;
    }

    /* سایدبارها */
    .sidebar {
        display: none !important;
    }

    /* دکمه‌ها در تبلت */
    .btn-group {
        flex-wrap: wrap !important;
    }

        .btn-group .btn {
            flex: 1 1 auto !important;
            min-width: 120px !important;
        }
}

/* 🖥 دسکتاپ */
@media (min-width: 993px) {
    /* افکت‌های حرفه‌ای فقط در دسکتاپ */
    .card-hover {
        transition: all 0.3s ease !important;
    }

        .card-hover:hover {
            transform: translateY(-8px) scale(1.02) !important;
            box-shadow: var(--shadow-medium) !important;
        }

    .container {
        max-width: 1200px !important;
    }
}

/* 🎯 کلاس‌های کمکی ریسپانسیو */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

.tablet-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .tablet-only {
        display: block !important;
    }
}

/* 📝 بهبود خوانایی در موبایل */
@media (max-width: 768px) {
    body {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    .text-desktop {
        font-size: 15px !important;
    }

    /* فاصله‌های بهینه */
    .section-py {
        padding: 3rem 0 !important;
    }

    .mb-desktop {
        margin-bottom: 1.5rem !important;
    }

    /* تراز متن */
    .text-center-mobile {
        text-align: center !important;
    }
}

/* 🔧 رفع مشکلات لمسی */
@media (max-width: 768px) {
    /* حداقل سایز برای المان‌های لمسی */
    .btn, .form-check-input, .nav-link, .dropdown-toggle {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* جلوگیری از highlight آبی در موبایل */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* بهبود اسکرول */
    .nav-scrollable {
        -webkit-overflow-scrolling: touch;
    }
}

/* 🎯 استایل‌های خاص برای صفحات */

/* صفحه لاگین و ثبت‌نام */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-medium);
    margin: 1rem;
}

@media (max-width: 576px) {
    .auth-container {
        padding: 2rem 1.5rem;
        margin: 0.5rem;
        border-radius: 16px;
    }
}

/* صفحه لیست‌ها */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (max-width: 576px) {
    .lists-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem 0;
    }
}

/* صفحه داشبورد */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 576px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* صفحه جزئیات لیست */
.list-detail-container {
    max-width: 100%;
    overflow: hidden;
}

.list-items-table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .list-items-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 🎯 بهبود Glass Effect برای موبایل */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--card-border-radius);
}

@media (max-width: 768px) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
    }
}

/* 🎯 بهبود ناوبری در موبایل */
.navbar-collapse {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }

    .nav-item {
        margin: 0.25rem 0;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .auth-btn {
        width: 100%;
        text-align: center;
    }
}

/* 🎯 بهبود فوتر */
footer {
    margin-top: auto;
}

@media (max-width: 768px) {
    footer .row {
        text-align: center;
    }

    footer .social-links {
        justify-content: center;
        margin: 1rem 0;
    }
}
