/* ============================================
   Mobile Responsive CSS for Oman Directory
   تصميم متجاوب للجوال - دليل عمان الشامل
   ============================================ */

/* General Mobile Styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Header Styles */
    .header {
        padding: 10px 0;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
        background: #40B69E;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 40px 0;
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 24px !important;
        margin-bottom: 20px;
    }
    
    .hero-title h2 {
        font-size: 28px !important;
        line-height: 1.2;
    }
    
    /* Search Section */
    .main-search-input-wrap {
        padding: 0 10px;
    }
    
    .search-header {
        margin-bottom: 15px;
    }
    
    .search-header h2 {
        font-size: 20px !important;
    }
    
    .search-header p {
        font-size: 14px;
    }
    
    .main-search-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-search-input-item {
        width: 100% !important;
        flex: none !important;
    }
    
    .main-search-input-item input,
    .main-search-input-item select {
        font-size: 16px !important;
        padding: 15px !important;
        border-radius: 8px !important;
    }
    
    .main-search-button {
        width: 100%;
        padding: 15px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    .quick-search-tags {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 15px;
    }
    
    .quick-search-tags a {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
    
    /* CTA Section */
    .business-cta-section {
        margin: 20px 10px;
    }
    
    .cta-card {
        padding: 20px !important;
        text-align: center;
    }

    .footer-cta-panel {
        padding: 38px 24px !important;
    }
    
    .cta-card h3 {
        font-size: 20px !important;
        margin-bottom: 15px;
    }

    .footer-cta-header {
        text-align: center;
    }
    
    .cta-card p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .footer-cta-header h3 {
        font-size: 24px !important;
    }

    .footer-cta-header p {
        font-size: 15px;
        line-height: 1.8;
    }
    
    .cta-card > div {
        flex-direction: column;
        gap: 10px;
    }

    .footer-cta-feature-list {
        justify-content: center;
    }
    
    .cta-btn-primary,
    .cta-btn-secondary {
        width: 100%;
        text-align: center;
        padding: 15px 20px !important;
        font-size: 16px;
    }

    .footer-cta-actions {
        padding-top: 24px;
    }

    .footer-cta-btn {
        width: 100%;
    }

    .footer-cta-feature-list {
        gap: 8px;
    }

    .footer-cta-feature-list li {
        width: 100%;
        justify-content: center;
    }
    
    /* Category Chips */
    .hero-feature-categories {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .category-chip {
        width: 100%;
        max-width: 200px;
        text-align: center;
        padding: 10px 15px;
        margin: 5px 0;
    }
    
    /* Listing Page */
    .listsearch-input-wrap {
        padding: 15px;
    }
    
    .listsearch-input-item {
        margin-bottom: 15px;
    }
    
    .listsearch-input-item label {
        font-size: 14px;
        margin-bottom: 8px;
        display: block;
    }
    
    .listsearch-input-item input,
    .listsearch-input-item select {
        font-size: 16px !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }
    
    .search-input-wrapper {
        position: relative;
    }
    
    .search-suggestions-btn {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #40B69E;
        font-size: 16px;
        padding: 5px;
    }
    
    .search-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        margin-top: 5px;
        padding: 15px;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .suggestion-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .suggestion-tag {
        font-size: 12px !important;
        padding: 6px 10px !important;
        border-radius: 15px;
    }
    
    /* Filter Section */
    .block-box.search-sb {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .list-searh-input-wrap-title {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    /* Listing Cards */
    .listings-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .listing-card {
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .listing-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .listing-card-content {
        padding: 15px;
    }
    
    .listing-card-title {
        font-size: 16px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .listing-card-meta {
        font-size: 12px;
        color: #666;
        margin-bottom: 10px;
    }
    
    .listing-card-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .listing-card-actions .btn {
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 5px;
    }
    
    /* Single Listing Page */
    .listing-single-content {
        padding: 15px;
    }
    
    .listing-single-header {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .listing-single-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .listing-single-gallery {
        margin-bottom: 20px;
    }
    
    .listing-single-gallery img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .listing-single-info {
        margin-bottom: 20px;
    }
    
    .listing-single-info h3 {
        font-size: 16px;
        margin-bottom: 10px;
        color: #40B69E;
    }
    
    .listing-single-info p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    
    .listing-single-contact {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .listing-single-contact .btn {
        width: 100%;
        margin-bottom: 10px;
        font-size: 14px;
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Business Registration Form */
    .business-registration-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        font-size: 16px !important;
        padding: 12px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 8px !important;
        transition: all 0.3s ease;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #40B69E !important;
        box-shadow: 0 0 0 3px rgba(64, 182, 158, 0.1) !important;
    }
    
    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }
    
    .form-submit {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        background: #40B69E;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .form-submit:hover {
        background: #2c8f7a;
        transform: translateY(-2px);
    }
    
    /* Admin Dashboard */
    .dashboard-content {
        padding: 10px;
    }
    
    .dashboard-title {
        margin-bottom: 20px;
    }
    
    .dashboard-title h2 {
        font-size: 20px;
    }
    
    .stat-card {
        margin-bottom: 15px;
        padding: 15px;
        text-align: center;
    }
    
    .stat-card h3 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .stat-card p {
        font-size: 12px;
        margin: 0;
    }
    
    /* Tables */
    .responsive-table {
        font-size: 12px;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* Buttons */
    .btn {
        font-size: 14px;
        padding: 8px 12px;
        border-radius: 5px;
        margin-bottom: 5px;
    }
    
    .btn-small {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Modal */
    .modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-header {
        padding: 15px 20px;
        margin: -20px -20px 20px -20px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .modal-title {
        font-size: 18px;
        margin: 0;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        margin: 20px -20px -20px -20px;
        border-top: 1px solid #e9ecef;
        text-align: center;
    }
    
    .modal-footer .btn {
        margin: 5px;
        min-width: 100px;
    }
    
    /* Pagination */
    .pagination-wrapper {
        margin: 20px 0;
        text-align: center;
    }
    
    .pagination {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 5px;
        text-decoration: none;
        font-size: 14px;
    }
    
    .pagination .current-page {
        background: #40B69E;
        color: white;
        border-color: #40B69E;
    }
    
    /* Footer */
    .footer {
        padding: 20px 10px;
        text-align: center;
    }
    
    .footer p {
        font-size: 12px;
        margin: 5px 0;
    }
    
    /* Floating WhatsApp Button */
    .floating-whatsapp {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
    
    /* Loading States */
    .loading {
        text-align: center;
        padding: 20px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #40B69E;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 10px;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Error Messages */
    .alert {
        padding: 12px 15px;
        margin: 10px 0;
        border-radius: 5px;
        font-size: 14px;
    }
    
    .alert-success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    
    .alert-danger {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    .alert-warning {
        background: #fff3cd;
        color: #856404;
        border: 1px solid #ffeaa7;
    }
    
    .alert-info {
        background: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }
    
    /* Success Messages */
    .success-message {
        background: #28a745;
        color: white;
        padding: 15px;
        border-radius: 5px;
        margin: 10px 0;
        text-align: center;
        font-size: 14px;
    }
    
    /* Tooltips */
    .tooltip {
        position: relative;
        cursor: help;
    }
    
    .tooltip-text {
        visibility: hidden;
        width: 200px;
        background-color: #333;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 8px;
        position: absolute;
        z-index: 1;
        bottom: 125%;
        left: 50%;
        margin-left: -100px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 12px;
    }
    
    .tooltip:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .hero-title h2 {
        font-size: 24px !important;
    }
    
    .cta-card h3 {
        font-size: 18px !important;
    }
    
    .listing-single-title {
        font-size: 18px;
    }
    
    .stat-card h3 {
        font-size: 20px;
    }
    
    .btn {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .form-submit {
        font-size: 14px;
        padding: 12px;
    }
    
    .modal-dialog {
        width: 98%;
        margin: 5px auto;
    }
    
    .floating-whatsapp {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 18px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 300px;
        padding: 30px 0;
    }
    
    .hero-title h2 {
        font-size: 22px !important;
    }
    
    .search-header {
        margin-bottom: 10px;
    }
    
    .search-header h2 {
        font-size: 18px !important;
    }
    
    .search-header p {
        font-size: 13px;
    }
    
    .cta-card {
        padding: 15px !important;
    }
    
    .cta-card h3 {
        font-size: 16px !important;
        margin-bottom: 10px;
    }

    .footer-cta-panel {
        padding: 30px 16px !important;
    }

    .footer-cta-header h3 {
        font-size: 18px !important;
    }

    .footer-cta-header p {
        font-size: 14px;
    }

    .footer-cta-btn {
        font-size: 15px;
        padding: 13px 18px !important;
    }

    .footer-cta-feature-list li {
        font-size: 13px;
        padding: 9px 12px;
    }
    
    .listing-single-gallery img {
        height: 180px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .listing-card-actions .btn,
    .form-submit {
        min-height: 44px;
        min-width: 44px;
    }
    
    .main-search-input-item input,
    .main-search-input-item select,
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
    }
    
    .category-chip {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .pagination a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .floating-whatsapp {
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    .btn {
        border-width: 0.5px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        border-width: 1px;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    body {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .hero-section {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .main-search-input-item input,
    .main-search-input-item select,
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #2c3e50;
        color: #ffffff;
        border-color: #34495e;
    }
    
    .listing-card {
        background: #2c3e50;
        color: #ffffff;
    }
    
    .listing-single-contact {
        background: #34495e;
    }
    
    .modal-content {
        background: #2c3e50;
        color: #ffffff;
    }
}
