/**
 * AUTO TESTER - المصرية لفحص السيارات
 * الملف: responsive.css
 * الوصف: تنسيقات الاستجابة لجميع الشاشات (Responsive Design)
 * الإصدار: 1.0
 */

/* ========================================
   الشاشات الكبيرة جداً (4K, 1400px+)
   ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

/* ========================================
   الشاشات الكبيرة (Laptops, 1200px - 1399px)
   ======================================== */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ========================================
   الشاشات المتوسطة (Tablets landscape, 992px - 1199px)
   ======================================== */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

/* ========================================
   الشاشات المتوسطة (Tablets portrait, 768px - 991px)
   ======================================== */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-links a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .sections-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        gap: 30px;
    }
    
    .user-info {
        display: none;
    }
    
    .notification-badge {
        top: -5px;
        right: -5px;
    }
}

/* ========================================
   الشاشات الصغيرة (Mobile landscape, 576px - 767px)
   ======================================== */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .navbar {
        padding: 0.8rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .nav-links a {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer {
        padding: 40px 0 20px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        justify-content: center;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-item {
        margin: 2px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .view-all {
        align-self: flex-start;
    }
}

/* ========================================
   الشاشات الصغيرة جداً (Mobile portrait, less than 576px)
   ======================================== */
@media (max-width: 575px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .user-menu {
        gap: 10px;
    }
    
    .logout-btn {
        padding: 5px 12px;
        font-size: 0.85rem;
    }
    
    .login-btn {
        padding: 5px 15px !important;
        font-size: 0.85rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .request-form,
    .search-box {
        padding: 20px;
    }
    
    .form-title h2 {
        font-size: 1.5rem;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .footer-title {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .contact-info li {
        font-size: 0.9rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }
    
    .steps-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .step {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: right;
    }
    
    .step-number {
        margin: 0;
    }
    
    .progress-steps::before {
        display: none;
    }
    
    .vehicle-item {
        flex-direction: column;
        text-align: center;
    }
    
    .vehicle-icon {
        margin: 0 auto 10px;
    }
    
    .inspector-card {
        flex-direction: column;
        text-align: center;
    }
    
    .inspector-avatar {
        margin: 0 auto 15px;
    }
    
    .rating {
        justify-content: center;
    }
    
    .request-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .request-status {
        align-self: flex-start;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-icon {
        margin-bottom: 10px;
    }
    
    .message {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message.user {
        align-items: flex-end;
    }
    
    .message-avatar {
        margin-bottom: 10px;
    }
    
    .chat-input-area {
        flex-direction: column;
    }
    
    .send-btn {
        width: 100%;
        border-radius: 50px;
    }
    
    .toast-notification {
        width: 90%;
        left: 5%;
        right: 5%;
        transform: none;
    }
}

/* ========================================
   الشاشات الصغيرة جداً (Very small phones, less than 360px)
   ======================================== */
@media (max-width: 359px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo i {
        font-size: 1.3rem;
    }
    
    .nav-links a {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .form-control {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .service-card {
        padding: 15px;
    }
    
    .service-icon {
        font-size: 2rem;
    }
    
    .service-name {
        font-size: 1rem;
    }
}

/* ========================================
   تنسيقات للشاشات الأفقية (Landscape)
   ======================================== */
@media (orientation: landscape) and (max-height: 600px) {
    .navbar {
        position: relative;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* ========================================
   تنسيقات للشاشات ذات الكثافة العالية (Retina)
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        font-weight: 700;
    }
    
    .btn {
        border-width: 1px;
    }
}

/* ========================================
   تنسيقات للطباعة (Print)
   ======================================== */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print,
    .tabs,
    .filters-section,
    .action-buttons,
    .pagination {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    th, td {
        border: 1px solid #ddd;
        padding: 8px;
    }
    
    .print-only {
        display: block !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ========================================
   تنسيقات خاصة بالشاشات التي تدعم اللمس (Touch devices)
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .nav-links a:hover {
        background: none;
    }
    
    .dropdown:hover .dropdown-content {
        display: none;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
}

/* ========================================
   تنسيقات لتحسين الأداء على الأجهزة البطيئة
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   تنسيقات للوضع الداكن (Dark Mode)
   ======================================== */
@media (prefers-color-scheme: dark) {
    body.dark-mode-support {
        background: var(--bg-dark);
        color: var(--text-white);
    }
}

/* ========================================
   تنسيقات للشاشات العرضية (Ultra-wide)
   ======================================== */
@media (min-width: 1600px) {
    .container {
        max-width: 1540px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.8rem;
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   تنسيقات للشاشات فائقة العرض (4K)
   ======================================== */
@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }
    
    html {
        font-size: 18px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .hero-subtitle {
        font-size: 2rem;
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========================================
   تنسيقات للشاشات المنخفضة (Small height)
   ======================================== */
@media (max-height: 600px) {
    .navbar {
        position: relative;
    }
    
    .hero-section {
        padding: 20px 0;
    }
    
    .modal {
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* ========================================
   تنسيقات للشاشات العالية (Tall screens)
   ======================================== */
@media (min-height: 1000px) {
    .hero-section {
        padding: 100px 0;
    }
    
    .footer {
        margin-top: 100px;
    }
}

/* ========================================
   تنسيقات خاصة بالأندرويد
   ======================================== */
@media (max-width: 768px) and (-webkit-touch-callout: none) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ========================================
   تنسيقات خاصة بأجهزة iPad
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .container {
        max-width: 90%;
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .container {
        max-width: 90%;
    }
    
    .features-grid,
    .types-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   تنسيقات لأجهزة Surface
   ======================================== */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .container {
        max-width: 90%;
    }
}

/* ========================================
   تنسيقات لشاشات الألعاب فائقة السرعة
   ======================================== */
@media (min-width: 1440px) and (min-refresh-rate: 120hz) {
    * {
        transition-duration: 0.2s;
    }
    
    .btn:hover {
        transition-duration: 0.1s;
    }
}

/* ========================================
   تنسيقات لإخفاء العناصر في وضع الطباعة
   ======================================== */
@media print {
    .print-hide {
        display: none !important;
    }
    
    .print-show {
        display: block !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
}

/* ========================================
   تنسيقات لتحسين التمرير على iOS
   ======================================== */
@supports (-webkit-overflow-scrolling: touch) {
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   تنسيقات للشاشات التي لا تدعم flexbox
   ======================================== */
@supports not (display: flex) {
    .nav-container,
    .stats-grid,
    .features-grid {
        display: block;
    }
    
    .nav-links {
        display: inline-block;
    }
    
    .nav-links a {
        display: inline-block;
        margin: 5px;
    }
}