/* Responsive Design - مواسات رضوی */

/* دستگاه‌های بسیار کوچک (عرض کمتر از 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stats-number {
        font-size: 1.8rem;
    }
    
    .stats-text {
        font-size: 0.9rem;
    }
    
    /* منوی ناوبری در موبایل */
    .navbar-collapse {
        background-color: #2e7d32;
        padding: 15px;
        margin-top: 10px;
        border-radius: 5px;
    }
    
    .navbar-nav {
        margin: 10px 0;
    }
    
    .nav-item {
        margin: 5px 0;
    }
    
    /* کارت‌ها در موبایل */
    .service-card,
    .product-card,
    .accommodation-card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* جدول‌ها در موبایل */
    .table-responsive {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 5px;
    }
    
    /* فرم‌ها در موبایل */
    .form-control {
        font-size: 16px; /* جلوگیری از zoom در iOS */
    }
    
    /* چت در موبایل */
    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 70px;
        left: 20px;
    }
}

/* دستگاه‌های کوچک (عرض 576px تا 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* دستگاه‌های متوسط (عرض 768px تا 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .hero-section {
        padding: 80px 0;
    }
}

/* دستگاه‌های بزرگ (عرض 992px تا 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* دستگاه‌های بسیار بزرگ (عرض 1200px به بالا) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .col-xl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* تنظیمات خاص برای تبلت */
@media (max-width: 1024px) and (orientation: landscape) {
    .hero-section {
        padding: 70px 0;
    }
    
    .navbar {
        padding: 10px 0;
    }
}

/* تنظیمات خاص برای موبایل در حالت landscape */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        padding: 50px 0;
    }
    
    .navbar {
        padding: 8px 0;
    }
    
    .section-title {
        margin-bottom: 20px;
    }
}

/* High DPI Devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand {
        font-weight: 600;
    }
    
    .btn {
        font-weight: 500;
    }
}

/* کاهش motion برای کاربران حساس به حرکت */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* حالت تاریک (Dark Mode) */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-bg: #1a1a1a;
        --dark-text: #ffffff;
        --dark-border: #444;
        --dark-card-bg: #2d2d2d;
    }
    
    body {
        background-color: var(--dark-bg);
        color: var(--dark-text);
    }
    
    .card {
        background-color: var(--dark-card-bg);
        border-color: var(--dark-border);
    }
    
    .table {
        color: var(--dark-text);
    }
    
    .table th {
        background-color: #2e7d32;
        color: white;
    }
    
    .table td {
        border-color: var(--dark-border);
    }
    
    .form-control {
        background-color: var(--dark-card-bg);
        border-color: var(--dark-border);
        color: var(--dark-text);
    }
}

/* چاپ */
@media print {
    .navbar,
    .chat-container,
    .chat-toggle,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        background: white;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* دستگاه‌های با عرض بسیار زیاد */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .col-xxl-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    
    .col-xxl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* بهینه‌سازی برای مرورگرهای مختلف */
@supports (display: grid) {
    .stats-cards {
        display: grid;
        gap: 20px;
    }
}

@supports not (display: grid) {
    .stats-cards {
        display: flex;
        flex-wrap: wrap;
        margin: -10px;
    }
    
    .stat-card {
        flex: 1 0 250px;
        margin: 10px;
    }
}

/* پشتیبانی از مرورگرهای قدیمی */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* استایل‌های خاص برای IE */
    .container {
        display: block;
    }
    
    .row {
        display: block;
    }
    
    .col-md-4 {
        width: 32%;
        float: left;
        margin-right: 2%;
    }
    
    .col-md-4:last-child {
        margin-right: 0;
    }
}

/* کاهش سایز فونت برای دستگاه‌های بسیار کوچک */
@media (max-width: 320px) {
    html {
        font-size: 14px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* افزایش سایز فونت برای دستگاه‌های بزرگ */
@media (min-width: 1600px) {
    html {
        font-size: 18px;
    }
}

/* بهینه‌سازی برای دستگاه‌های لمسی */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 12px 24px;
        min-height: 44px;
    }
    
    .nav-link {
        padding: 15px;
        min-height: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
}