/* რესპონსიული დიზაინი - მობილური ვერსია */

/* ტაბლეტი და მობილური (768px და ნაკლები) */
@media (max-width: 768px) {
    /* სურათის ნავიგაცია ყოველთვის ხილულია მობილურზე */
    .image-navigation {
        opacity: 1;
    }

    /* Header */
    header.app-header {
        padding: 18px 15px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .header-logo {
        font-size: 20px;
    }

    .header-actions {
        gap: 8px;
        margin-left: auto;
        flex-direction: row-reverse;
    }

    .action-button {
        padding: 10px 15px;
        font-size: 13px;
    }

    .language-button {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* 🔥 Search Section - ლურჯი ფონი მთელ სიგანეზე */
    .search-section {
        padding: 30px 0;
        margin: 0 !important; /* ←← აქ იყო 15px, ახლა 0 */
        margin-bottom: 20px !important; /* ქვემოთ დავტოვოთ მარჯინი */
    }

    .search-section h2 {
        font-size: 24px;
        padding: 0 15px; /* შიგნით padding შინაარსისთვის */
    }

    .search-form {
        margin: 0 15px; /* ფორმის თეთრი ბარათი შიგნიდან მარჯინი */
        padding: 20px 15px;
    }

    .form-row,
    .detailed-search-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .checkbox-section {
        grid-template-columns: 1fr;
    }

    .form-control,
    .price-range-toggle-button,
    .detailed-search-toggle-button {
        font-size: 14px;
        padding: 10px;
    }

    .price-range-fields input {
        font-size: 14px;
        padding: 10px;
    }

    .date-range-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    input[type="datetime-local"] {
        font-size: 14px;
        padding: 10px;
    }

    /* ძიების შედეგების სექცია */
    .results-section {
        padding: 25px 15px;
    }

    .results-section h2 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    /* ძიების შედეგების Container */
    #resultsContainer {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 0 15px !important;
        justify-items: center !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* ძიების შედეგების ბარათები */
    #resultsContainer .property-card {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        border-radius: 10px;
    }

    /* ახალი განცხადებების სექცია */
    .property-section {
        padding: 25px 15px;
    }

    /* ახალი განცხადებების Container */
    .property-list {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 0 15px !important;
        justify-items: center !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* ახალი განცხადებების ბარათები - იგივე ზომა */
    .property-list .property-card {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        border-radius: 10px;
    }

    /* ბარათის შიდა ელემენტები */
    .property-images {
        height: 200px;
    }

    .property-card h3 {
        font-size: 18px;
        margin: 16px 16px 12px 16px;
    }

    .property-details {
        padding: 0 16px;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .property-detail {
        padding: 8px 12px;
        font-size: 12px;
    }

    .property-features {
        padding: 0 16px 16px 16px;
        gap: 6px;
    }

    .feature-tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .property-actions {
        padding: 0 16px 16px 16px;
        flex-direction: column;
        gap: 10px;
    }

    .property-button {
        width: 100%;
        justify-content: center;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .loading, .empty-properties, .error {
        padding: 40px 20px;
        margin: 20px auto;
    }

    /* ============================================
       🆕 თარიღის dropdown - სრული ეკრანის რეჟიმი
    ============================================ */
    .datetime-field {
        width: 100%;
    }

    .datetime-dropdown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        z-index: 2000 !important;
        display: none;
        flex-direction: column;
        overflow: hidden;
        margin-top: 0 !important;
    }

    .datetime-dropdown.show {
        display: flex !important;
    }

    /* 🆕 Header - ფიქსირებული */
    .datetime-dropdown .dropdown-header {
        flex-shrink: 0;
        padding: 15px;
        border-bottom: 1px solid #eee;
        background: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dropdown-header h4 {
        font-size: 16px;
        font-weight: 600;
        color: #333;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dropdown-header button {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #999;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 🆕 კალენდრის სექცია - JavaScript დაამალავს */
    .datetime-dropdown .date-section {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        background: white;
    }

    /* კალენდარი */
    .calendar-container {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background: white;
    }

    .calendar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        gap: 15px;
    }

    .calendar-header button {
        padding: 10px 15px;
        border: 1px solid #ddd;
        background: white;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        min-height: 44px;
        min-width: 44px;
    }

    .calendar-header h3 {
        font-size: 18px;
        font-weight: 600;
        flex: 1;
        text-align: center;
        color: #333;
    }

    /* კვირის დღეები */
    .days-of-week {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 8px;
        margin-bottom: 12px;
        text-align: center;
    }

    .days-of-week div {
        font-weight: 600;
        color: #666;
        font-size: 12px;
        padding: 8px 4px;
    }

    /* კალენდრის რიცხვები */
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .calendar-day {
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 500;
        font-size: 16px;
        background: white;
        transition: all 0.3s ease;
        min-height: 45px;
    }

    .calendar-day.empty {
        cursor: default;
        background: transparent;
        border: none;
    }

    .calendar-day.past-date {
        background: #f5f5f5;
        color: #999;
        cursor: not-allowed;
        border-color: #ddd;
    }

    .calendar-day.today {
        border-color: #ff6b6b;
        background: #fff5f5;
        color: #ff6b6b;
        font-weight: 700;
    }

    .calendar-day.selected {
        background: #1e90ff;
        color: white;
        border-color: #1e90ff;
    }

    .calendar-day:not(.empty):not(.past-date):hover {
        border-color: #1e90ff;
        background: #e6f0ff;
        transform: scale(1.05);
    }

    /* 🆕 წიგნის ტიპის სელექტორი */
    .booking-type-selector {
        display: none; /* JavaScript გააქტიურებს */
        flex-shrink: 0;
        gap: 10px;
        margin: 0;
        padding: 15px;
        border-bottom: 1px solid #eee;
        background: white;
    }

    .booking-type-btn {
        flex: 1;
        padding: 12px 10px;
        border: 2px solid #ddd;
        background: white;
        border-radius: 6px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        color: #666;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 48px;
    }

    .booking-type-btn.active {
        background: #1e90ff;
        color: white;
        border-color: #1e90ff;
    }

    .booking-type-btn i {
        font-size: 14px;
    }

    /* 🆕 საათების სექცია */
    .time-section {
        flex: 1;
        overflow-y: auto;
        padding: 0 15px;
        margin-bottom: 15px;
        background: white;
        display: none; /* JavaScript გააქტიურებს */
    }

    .time-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 15px;
        padding-top: 15px;
    }

    .hour-slot {
        padding: 12px 8px;
        border: 2px solid #e0e0e0;
        background: white;
        border-radius: 6px;
        text-align: center;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: #333;
        transition: all 0.3s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hour-slot.past-hour {
        background: #f5f5f5;
        color: #999;
        border-color: #ddd;
        cursor: not-allowed;
    }

    .hour-slot.selected {
        background: #1e90ff;
        color: white;
        border-color: #1e90ff;
    }

    .hour-slot:not(.past-hour):hover {
        border-color: #1e90ff;
        background: #e6f0ff;
    }

    /* 🆕 შერჩეული ინფორმაცია */
    .selected-info {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 8px;
        margin: 15px;
        flex-shrink: 0;
    }

    .selected-info h4 {
        color: #333;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .selected-info p {
        font-size: 13px;
        color: #666;
        margin: 6px 0;
        padding: 4px 0;
    }

    .selected-info p strong {
        color: #333;
        font-weight: 600;
    }

    /* 🆕 ღილაკები - ფიქსირებული ქვემოთ */
    .dropdown-actions {
        display: flex;
        gap: 10px;
        padding: 15px;
        background: #f8f9fa;
        border-top: 1px solid #eee;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    .btn-dropdown {
        flex: 1;
        padding: 14px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 15px;
        font-weight: 600;
        transition: all 0.3s ease;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-clear {
        background: #6c757d;
        color: white;
    }

    .btn-clear:active {
        background: #5a6268;
        transform: scale(0.98);
    }

    .btn-confirm {
        background: #1e90ff;
        color: white;
    }

    .btn-confirm:active {
        background: #1575d6;
        transform: scale(0.98);
    }

    /* 🆕 მთელი დღე შეტყობინება */
    .time-grid > div[style*="grid-column"] {
        grid-column: 1 / -1 !important;
        padding: 20px !important;
        background: #e3f2fd;
        border-radius: 8px;
        font-size: 14px;
        color: #1e90ff;
        text-align: center;
        border: 2px solid #1e90ff;
        font-weight: 600;
    }
}

/* მცირე მობილური (480px და ნაკლები) */
@media (max-width: 480px) {
    /* Header */
    header.app-header {
        flex-direction: row;
        align-items: center;
        padding: 15px 10px;
        justify-content: space-between;
    }

    .header-actions {
        margin-top: 0;
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
        flex-direction: row-reverse;
    }

    .action-button,
    .language-dropdown {
        flex-grow: 0;
        text-align: center;
        justify-content: center;
    }

    .language-dropdown-content {
        right: 0;
        left: auto;
        transform: none;
        min-width: 140px;
    }

    /* 🔥 Search Section - პატარა ეკრანებზე */
    .search-section {
        padding: 20px 0;
        margin: 0 !important; /* ←← აქაც 0 */
        margin-bottom: 20px !important;
    }

    .search-section h2 {
        font-size: 20px;
        padding: 0 10px;
    }

    .search-form {
        margin: 0 10px; /* შიდა padding პატარა */
        padding: 15px 10px;
    }

    .form-control,
    .price-range-toggle-button,
    .detailed-search-toggle-button,
    .price-range-fields input,
    .search-button {
        font-size: 13px;
        padding: 8px;
    }

    input[type="datetime-local"] {
        font-size: 13px;
        padding: 8px;
    }

    /* ძიების შედეგების სექცია */
    .results-section {
        padding: 20px 10px;
    }

    .results-section h2 {
        font-size: 28px;
    }

    /* ძიების შედეგების Container */
    #resultsContainer {
        grid-template-columns: 1fr !important;
        padding: 0 15px !important;
        justify-items: center !important;
        max-width: 100% !important;
    }

    /* ძიების შედეგების ბარათები */
    #resultsContainer .property-card {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        border-radius: 8px;
    }

    /* ახალი განცხადებების სექცია */
    .property-section {
        padding: 20px 10px;
    }

    /* ახალი განცხადებების Container */
    .property-list {
        grid-template-columns: 1fr !important;
        padding: 0 15px !important;
        justify-items: center !important;
        max-width: 100% !important;
    }

    /* ახალი განცხადებების ბარათები - იგივე ზომა */
    .property-list .property-card {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        border-radius: 8px;
    }

    /* ბარათის შიდა ელემენტები */
    .property-card h3 {
        font-size: 16px;
        margin: 12px 12px 10px 12px;
    }

    .property-details {
        padding: 0 12px;
        margin-bottom: 12px;
    }

    .property-detail {
        padding: 6px 10px;
        font-size: 11px;
    }

    .property-features {
        padding: 0 12px 12px 12px;
    }

    .feature-tag {
        font-size: 10px;
        padding: 4px 8px;
    }

    .property-actions {
        padding: 0 12px 12px 12px;
    }

    .loading, .empty-properties, .error {
        padding: 30px 15px;
        margin: 15px auto;
    }

    /* 🆕 კალენდარი მობილურზე - კომპაქტური */
    .calendar-grid {
        gap: 6px;
    }

    .calendar-day {
        font-size: 14px;
        min-height: 40px;
        border-width: 1.5px;
    }

    /* 🆕 საათები - 3 სვეტი პატარა ეკრანებზე */
    .time-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .hour-slot {
        font-size: 12px;
        padding: 10px 6px;
        min-height: 44px;
    }

    .booking-type-selector {
        gap: 8px;
        padding: 12px;
    }

    .booking-type-btn {
        font-size: 12px;
        padding: 10px 8px;
        min-height: 44px;
    }

    .dropdown-header h4 {
        font-size: 14px;
    }

    .btn-dropdown {
        font-size: 14px;
        padding: 12px;
        min-height: 44px;
    }

    .selected-info {
        padding: 12px;
        margin: 12px;
    }

    .selected-info h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .selected-info p {
        font-size: 12px;
        margin: 4px 0;
    }
}

/* მობილური მენიუს სტილები */
@media (max-width: 768px) {
    /* Header overflow fix */
    header.app-header {
        overflow: visible !important;
        position: relative;
        z-index: 1000;
    }
    
    /* მენიუს dropdown */
    .menu-dropdown {
        position: relative;
        z-index: 1001;
    }
    
    .menu-dropdown-content {
        position: absolute;
        top: 100% !important;
        right: 0;
        left: auto;
        background-color: white;
        min-width: 200px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        overflow: visible;
        z-index: 1002 !important;
        transform: translateY(5px);
        border: 1px solid #e0e0e0;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .menu-dropdown.show .menu-dropdown-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .menu-item {
        padding: 15px 20px;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 16px;
        border-bottom: 1px solid #f1f3f5;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .menu-button {
        color: #ffffff !important;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        font-weight: 500;
    }
    
    .menu-button .menu-icon {
        order: 0;
        margin-right: 6px;
        margin-left: 0;
    }
    
    .menu-button .menu-icon::before,
    .menu-button .menu-icon::after,
    .menu-button .menu-icon div {
        background-color: #ffffff !important;
    }
    
    /* ენის dropdown */
    .language-dropdown {
        position: relative;
        z-index: 1001;
    }
    
    .language-dropdown-content {
        position: absolute;
        top: 100% !important;
        right: 0;
        left: auto;
        background-color: white;
        min-width: 150px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        overflow: visible;
        z-index: 1002 !important;
        transform: translateY(5px);
        border: 1px solid #e0e0e0;
    }
    
    .language-dropdown.show .language-dropdown-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .language-dropdown-content a {
        padding: 12px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* ულტრა მობილური dropdown პოზიციონირება */
@media (max-width: 480px) {
    header.app-header {
        flex-direction: row;
        align-items: center;
        padding: 15px 10px;
        overflow: visible !important;
        position: relative;
        justify-content: space-between;
    }
    
    .header-actions {
        margin-top: 0;
        width: auto;
        justify-content: flex-end;
        position: relative;
        flex-shrink: 0;
    }
    
    .menu-dropdown-content {
        right: 0;
        left: auto;
        width: auto;
        min-width: 200px;
        max-width: 250px;
    }
    
    .language-dropdown-content {
        right: 0;
        left: auto;
        min-width: 120px;
        transform: translateY(5px);
    }
}

/* Touch devices მხარდაჭერა */
@media (pointer: coarse) {
    .menu-button,
    .language-button {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .menu-item,
    .language-dropdown-content a {
        min-height: 48px;
        padding: 16px 20px;
    }
}

/* Hover effects გათიშვა touch devices-ზე */
@media (hover: none) and (pointer: coarse) {
    .menu-item:hover,
    .language-dropdown-content a:hover {
        background-color: transparent;
    }
    
    .menu-item:active,
    .language-dropdown-content a:active {
        background-color: #f8f9fa;
        transform: scale(0.98);
    }
}