/* Datetime picker dropdown */
.datetime-field {
    position: relative;
}

.datetime-display {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.3s ease;
    color: #495057;
    display: flex;
    align-items: center;
}

.datetime-display:hover {
    border-color: #1e90ff;
}

.datetime-display.active {
    border-color: #1e90ff;
    box-shadow: 0 0 0 0.2rem rgba(30, 144, 255, 0.25);
}

.datetime-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.datetime-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

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

.date-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.date-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.date-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Calendar styling for date range selection */
.calendar-container {
    font-family: 'Poppins', sans-serif;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    color: #333;
}

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

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #1e90ff;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.calendar-header button:hover {
    background-color: #e3f2fd;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.days-of-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 500;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.days-of-week div {
    padding: 8px 0;
    font-size: 0.9em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
    color: #34495e;
    background-color: #fcfcfc;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day:not(.empty):not(.selected):hover {
    background-color: #e3f2fd;
    border-color: #a0d8ff;
}

/* Styles for selected, booked, available */
.calendar-day.selected {
    background: #1e90ff !important;
    color: white !important;
    font-weight: 600;
}

.calendar-day.booked {
    background:#dc3545 !important;
    color:white !important;
    cursor:not-allowed !important;
    opacity: 0.7;
}

.calendar-day.available {
    background:#28a745;
    color:white;
}

/* Past dates */
.calendar-day.past-date {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.7;
}

.calendar-day.today {
    border: 2px solid #1e90ff;
    background-color: #e0f2f7;
}

.time-section {
    padding: 15px;
    display: none;
}

.time-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 2px;
}

.time-slot {
    padding: 10px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    background: white;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    background: #e3f2fd;
    border-color: #1976d2;
    transform: translateY(-1px);
}

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

.hour-slot.booked {
    background:#dc3545;
    border-color:#dc3545;
    color:white;
    cursor:not-allowed;
}

.hour-slot.past-hour {
    background-color: #e9ecef;
    border-color: #ccc;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.booked-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-actions {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #eee;
}

.btn-dropdown {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    flex: 1;
    min-height: 38px;
}

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

.btn-clear:hover {
    background: #5a6268;
}

/* საათების არჩევის ღილაკი - მწვანე */
.btn-show-hours {
    background: #28a745;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-show-hours:hover {
    background: #218838;
}

.btn-show-hours:active {
    background: #1e7e34;
    transform: scale(0.98);
}

.btn-show-hours i {
    font-size: 14px;
}

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

.btn-confirm:hover {
    background: #1575d6;
}

/* Booking type selector */
.booking-type-selector {
    display: flex;
    gap: 10px;
    margin: 15px;
    justify-content: center;
    display: none;
}

.booking-type-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

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

.selected-info{
    background:linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%);
    padding:15px;
    margin:15px;
    border-radius:10px;
    border-left:4px solid #1e90ff
}

.selected-info h4{
    color:#333;
    margin-bottom:8px;
    font-weight:600;
    font-size:15px
}

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

/* ===== მობილური - სრული ეკრანი ===== */
@media (max-width: 768px) {
    .datetime-dropdown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
        z-index: 2000 !important;
        display: none;
        flex-direction: column;
        overflow: hidden;
        margin-top: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !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;
        position: sticky;
        top: 0;
        z-index: 2001;
        border-radius: 0;
    }

    .dropdown-header h4 {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        margin: 0;
    }

    .dropdown-header button {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: #999;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .dropdown-header button:active {
        background: #f0f0f0;
    }

    /* კალენდარი - scrollable */
    .datetime-dropdown .date-section {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        background: white;
    }

    .calendar-container {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background: white;
        box-shadow: none;
        border-radius: 0;
    }

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

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

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

    .days-of-week {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        margin-bottom: 10px;
        text-align: center;
    }

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

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        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: 14px;
        background: white;
        transition: all 0.3s;
        min-height: 40px;
        padding: 0;
    }

    .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 !important;
        color: white !important;
        border-color: #1e90ff !important;
    }

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

    /* რეზერვირების ტიპი */
    .booking-type-selector {
        display: none;
        flex-shrink: 0;
        gap: 10px;
        padding: 15px;
        border-bottom: 1px solid #eee;
        background: white;
        margin: 0;
    }

    .booking-type-selector.show {
        display: flex !important;
    }

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

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

    /* დრო */
    .datetime-dropdown .time-section {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background: white;
        display: none;
    }

    .time-section.show {
        display: block !important;
    }

    .time-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 15px;
        max-height: none;
        overflow-y: visible;
    }

    .hour-slot {
        padding: 12px 8px;
        border: 2px solid #e0e0e0;
        background: white;
        border-radius: 6px;
        text-align: center;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        color: #333;
        transition: all 0.3s;
        min-height: 44px;
        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: #e3f2fd;
        padding: 15px;
        border-radius: 8px;
        margin: 15px;
        flex-shrink: 0;
        border-left: 4px solid #1e90ff;
    }

    .selected-info h4 {
        color: #1e90ff;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
    }

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

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

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

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

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

    /* საათების არჩევა ღილაკი მობილურზე - მწვანე */
    .btn-show-hours {
        flex: 1;
        padding: 10px;
        font-size: 14px;
        font-weight: 600;
        min-height: 42px;
        background: #28a745;
        color: white;
    }

    .btn-show-hours:active {
        background: #218838;
        transform: scale(0.98);
    }

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

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

/* მცირე მობილური (480px) */
@media (max-width: 480px) {
    .calendar-grid {
        gap: 4px;
    }

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

    .time-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

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

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

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

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

    .btn-dropdown {
        font-size: 13px;
        padding: 10px;
        min-height: 40px;
    }

    .btn-show-hours {
        font-size: 13px;
        padding: 10px;
        min-height: 40px;
    }

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

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

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