/**
 * Room Availability Calendar - Modal Styles
 *
 * @package     com_roomavailabilitycalendar
 * @copyright   Copyright (C) 2024 Your Name. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/* Enhanced Form Styles - dodajte na početak fajla */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
}

.form-section-title {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: bold;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row .form-group {
    padding: 0 10px;
}

/* Ove klase važe samo na md+ ekranima — na mobilnom Bootstrap ih vraća na 100% */
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.checkbox-item:hover {
    background-color: #f0f0f0;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
}

.child-ages-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.child-ages-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.child-age-input {
    flex: 0 0 120px;
}

.price-estimate {
    background-color: #e8f5e8 !important;
    border-color: #28a745 !important;
}

.price-breakdown {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.price-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.price-item.total {
    border-top: 2px solid #28a745;
    border-bottom: none;
    font-size: 1.1em;
    margin-top: 10px;
    padding-top: 10px;
}

.price-note {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1em;
}

.btn-icon {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .form-row .form-group {
        flex: 0 0 100%;
        max-width: 100%;
    }

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

/* Room Cards Styles - dodajte na početak fajla */
.room-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover samo na uređajima koji stvarno imaju hover (ne touch) */
@media (hover: hover) {
    .room-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
}

.room-header { margin-bottom: 15px; }
.room-title { margin: 0; color: #2c3e50; font-size: 1.2em; }
.room-image { margin-bottom: 15px; text-align: center; height: 200px; overflow: hidden; border-radius: 4px; background-color: #f8f9fa; }
.room-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-image { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #6c757d; background-color: #e9ecef; }
.placeholder-image .icon-home { font-size: 3em; margin-bottom: 10px; }
.room-description { flex-grow: 1; margin-bottom: 15px; color: #555; line-height: 1.5; }
.room-actions { margin-top: auto; }

/* Gallery Modal Styles */
.gallery-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.gallery-image { text-align: center; }
.gallery-image img { width: 100%; height: 200px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }

@media (max-width: 768px) {
    .gallery-images { grid-template-columns: 1fr; }
}
/* ==========================================================================
   CALENDAR CONTAINER
   ========================================================================== */

.roomavailability-calendar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calendar-container {
    margin-bottom: 30px;
}

.calendar-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ==========================================================================
   CALENDAR TABLE
   ========================================================================== */

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: top;
    position: relative;
}

.calendar-table th {
    background-color: #337ab7;
    color: white;
    padding: 12px 8px;
    font-weight: bold;
    font-size: 14px;
}

/* ==========================================================================
   CALENDAR DAYS
   ========================================================================== */

.calendar-day {
    padding: 8px;
    min-height: 80px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.calendar-day:not(.empty-day):not(.past):not(.fully-booked):hover {
    background-color: #e6f3ff !important;
    border-color: #337ab7 !important;
    transform: scale(1.05);
}

.calendar-day.available {
    background-color: #dff0d8;
    color: #3c763d;
}

.calendar-day.fully-booked {
    background-color: #f2dede !important;
    color: #a94442;
}

.calendar-day.past {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

.calendar-day.today {
    border: 3px solid #ff6b35 !important;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.calendar-day.empty-day {
    background-color: #fafafa !important;
    cursor: default !important;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

.day-slots {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* ==========================================================================
   CALENDAR NAVIGATION
   ========================================================================== */

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

.calendar-month-header {
    margin: 0;
    font-size: 1.8em;
    color: #337ab7;
    font-weight: bold;
}

.nav-btn {
    background-color: #337ab7;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: #286090;
}

.nav-btn:focus {
    outline: 2px solid #5bc0de;
    outline-offset: 2px;
}

/* ==========================================================================
   CALENDAR LEGEND
   ========================================================================== */

.calendar-legend {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1;
}

.legend-color {
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.available {
    background-color: #dff0d8;
}

.legend-color.fully-booked {
    background-color: #f2dede;
}

.legend-color.past {
    background-color: #f5f5f5;
}

/* ==========================================================================
   MODAL OVERLAY
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 30px 0 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   MODAL DIALOG
   ========================================================================== */

.modal-dialog {
    max-width: 500px;
    width: 90%;
    max-height: none;
    overflow-y: visible;
    margin: 0 auto;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* ==========================================================================
   MODAL HEADER
   ========================================================================== */

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-title {
    margin: 0;
    font-size: 1.4em;
    color: #337ab7;
    font-weight: bold;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background-color: #ff4757;
    color: white;
}

.btn-close:focus {
    outline: 2px solid #ff4757;
    outline-offset: 2px;
}

/* ==========================================================================
   MODAL BODY
   ========================================================================== */

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #ddd;
    text-align: right;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

/* ==========================================================================
   TIMESLOT OPTIONS
   ========================================================================== */

.timeslot-option {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.timeslot-option:hover {
    background-color: #e9ecef;
    border-color: #337ab7;
    text-decoration: none;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeslot-option.available {
    background-color: #dff0d8;
    border-color: #5cb85c;
    color: #3c763d;
}

.timeslot-option.available:hover {
    background-color: #d4edda;
    border-color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.timeslot-option.unavailable {
    background-color: #f2dede;
    border-color: #d9534f;
    color: #a94442;
    cursor: not-allowed;
    opacity: 0.7;
}

.timeslot-option.unavailable:hover {
    transform: none;
    box-shadow: none;
}

.timeslot-option.selected {
    background-color: #007bff;
    border-color: #0056b3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #337ab7;
    color: white;
}

.btn-primary:hover {
    background-color: #286090;
    text-decoration: none;
    color: white;
}

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

.btn-secondary:hover {
    background-color: #545b62;
    text-decoration: none;
    color: white;
}

.btn-outline-primary {
    border: 2px solid #337ab7;
    color: #337ab7;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #337ab7;
    color: white;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #337ab7;
    box-shadow: 0 0 0 2px rgba(51, 122, 183, 0.2);
}

.form-control:invalid {
    border-color: #d9534f;
}

.form-control:invalid:focus {
    border-color: #d9534f;
    box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.2);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    text-align: right;
}

.form-actions .btn {
    margin-left: 10px;
}

/* Required field indicator */
.required::after {
    content: " *";
    color: #d9534f;
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons .btn {
    margin: 0;
}

/* ==========================================================================
   ALERT STYLES
   ========================================================================== */

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #337ab7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/*@media (max-width: 768px) {
    .roomavailability-calendar {
        padding: 10px;
    }

    .calendar-table th,
    .calendar-day {
        font-size: 12px;
        padding: 5px;
        min-height: 60px;
    }

    .calendar-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .calendar-month-header {
        font-size: 1.4em;
    }

    .calendar-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .modal-dialog {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .form-actions {
        text-align: center;
    }

    .form-actions .btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }

    .timeslot-option {
        padding: 12px;
        font-size: 13px;
    }
}*/

@media (max-width: 480px) {
    .calendar-table th,
    .calendar-day {
        font-size: 10px;
        padding: 3px;
        min-height: 50px;
    }

    .day-number {
        font-size: 14px;
    }

    .day-slots {
        font-size: 10px;
    }

    .modal-content {
        border-radius: 0;
    }

    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }

    .modal-header {
        border-radius: 0;
    }

    .modal-footer {
        border-radius: 0;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus styles for keyboard navigation */
.calendar-day:focus {
    outline: 2px solid #337ab7;
    outline-offset: -2px;
}

.timeslot-option:focus {
    outline: 2px solid #337ab7;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calendar-day {
        border-width: 2px;
    }

    .modal-overlay {
        background-color: rgba(0,0,0,0.8);
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .calendar-day:hover {
        transform: none;
    }

    .timeslot-option:hover {
        transform: none;
    }

    .modal-content {
        transform: none;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .modal-overlay {
        display: none !important;
    }

    .nav-btn {
        display: none;
    }

    .action-buttons {
        display: none;
    }

    .calendar-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }

    .calendar-day {
        border: 1px solid #000;
    }
}
/*dodajem stilove za modal zatvaranje
/* Dodajte u calendar-modal.css */

/* Modal Close Button */
.btn-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.btn-close:hover {
    background-color: #ff4757;
    color: white;
    transform: scale(1.1);
}

.btn-close:focus {
    outline: 2px solid #ff4757;
    outline-offset: 2px;
}

/* Modal Header */
.modal-header {
    position: relative;
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-title {
    margin: 0;
    font-size: 1.4em;
    color: #337ab7;
    font-weight: bold;
    padding-right: 50px; /* Space for close button */
}

/* Calendar Day Cursor */
.calendar-day:not(.empty-day):not(.past) {
    cursor: pointer !important;
}

/*.calendar-day:not(.empty-day):not(.past):not(.fully-booked):hover {
    background-color: #e6f3ff !important;
    border-color: #337ab7 !important;
    transform: scale(1.05);
}*/
/*.calendar-day:not(.empty-day):not(.past):not(.fully-booked):hover {
    background-color: #e6f3ff !important;
    border-color: #337ab7 !important;
    transform: scale(1.05)
}*/

/* Navigation Buttons */
.nav-btn {
    background-color: #337ab7;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: #286090;
}

/* Modal Display Fix */
.modal-overlay.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
/*slajder stilovi*/
.room-image-slider .slider-container {
    position: relative;
    width: 100%;
    height: 400px; /* ili željenu visinu */
    overflow: hidden;
}

.room-image-slider .slide {
    display: none; /* Sakrij sve slide-ove */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.room-image-slider .slide.active {
    display: block; /* Prikaži samo aktivan slide */
}

.room-image-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ili contain */
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.nav-btn.prev {
    left: 10px;
}

.nav-btn.next {
    right: 10px;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.image-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10;
}
/* ═══════════════════════════════════════════════════════════════
   TOTALNA BLOKADA: Fully Booked bez promena na hover
   ═══════════════════════════════════════════════════════════════ */

/* 1. Resetovanje svega: Boja ostaje ista, nema skaliranja, nema plave ivice */
.roomavailability-calendar .calendar-table td.calendar-day.fully-booked:hover {
    background-color: #f2dede !important; /* Forsiramo crvenu pozadinu i na hover */
    transform: none !important;            /* Sprečava povećanje (scale 1.05) */
    border-color: #ddd !important;         /* Vraća običnu sivu ivicu umesto plave */
    box-shadow: none !important;           /* Uklanja bilo kakvu senku */
    cursor: not-allowed !important;        /* Pokazuje znak zabrane na kursoru */
}

/* 2. Onemogućavanje klika (CSS-only barijera) */
.roomavailability-calendar .calendar-day.fully-booked {
    pointer-events: none !important;       /* Ovo potpuno sprečava klik i otvaranje modala */
    position: relative;
    background-color: #f2dede !important;
}

/* 3. Prikaz krugića sa zabranom na hover */
/* Pošto smo u koraku 2 stavili pointer-events: none, moramo ga vratiti
   samo za hover da bi se krug video, ali pointer-events na roditelju
   će i dalje štititi od klika u većini slučajeva */
.calendar-day.fully-booked {
    pointer-events: auto !important;
}

/* Sprečavanje bilo kakve akcije (modala) ako neko klikne */
.calendar-day.fully-booked a,
.calendar-day.fully-booked button {
    display: none !important;
}

/* 4. Mali krug sa znakom zabrane koji se pojavljuje iznad */
.calendar-day.fully-booked::before {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    opacity: 0;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.5); /* Providni beli krug */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Krug ne smeta mišu */
}

.calendar-day.fully-booked:hover::before {
    opacity: 1; /* Krug se pojavljuje samo kad je miš iznad */
}
/* ═══════════════════════════════════════════════════════════════
   KOMPLETNA MOBILE RESPONSIVE OPTIMIZACIJA
   Autor: Multiday Booking System
   Datum: 04.01.2026
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   TABLET (max-width: 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ═══ CALENDAR CONTAINER ═══ */
    .roomavailability-calendar {
        padding: 10px !important;
        max-width: 100% !important;
    }

    .calendar-wrapper {
        padding: 10px !important;
        border-radius: 5px !important;
    }

    /* ═══ CALENDAR NAVIGATION ═══ */
    .calendar-navigation {
        flex-direction: row !important; /* Drži Previous/Next u istom redu */
        gap: 10px !important;
        padding: 0 5px !important;
    }

    .calendar-month-header {
        font-size: 1.2em !important;
    }

    .nav-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    /* ═══ CALENDAR TABLE ═══ */
    .calendar-table {
        font-size: 11px !important;
    }

    .calendar-table th {
        padding: 8px 4px !important;
        font-size: 11px !important;
    }

    /* ═══ CALENDAR DAYS ═══ */
    .calendar-day {
        padding: 4px !important;
        min-height: 60px !important;
    }

    .day-number {
        font-size: 13px !important;
        margin-bottom: 3px !important;
    }

    .day-slots,
    .available-slots {
        font-size: 8px !important;
        margin-top: 3px !important;
    }

    /* ═══ FULLY BOOKED - Krug UVEK vidljiv ═══ */
    .calendar-day.fully-booked::before {
        opacity: 1 !important;
        font-size: 16px !important;
        width: 26px !important;
        height: 26px !important;
        top: 5px !important;
        right: 5px !important;
        left: auto !important;
        transform: none !important;
    }

    .calendar-day.fully-booked .available-slots {
        font-size: 8px !important;
    }

    .calendar-day.fully-booked .day-number {
        font-size: 12px !important;
    }

    /* ═══ CALENDAR LEGEND ═══ */
    .calendar-legend {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    .legend-item {
        font-size: 11px !important;
    }

    .legend-color {
        width: 18px !important;
        height: 18px !important;
    }

    /* ═══ MODAL ═══ */
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 12px !important;
    }

    .modal-title {
        font-size: 1.1em !important;
        padding-right: 40px !important;
    }

    /* ═══ TIMESLOT OPTIONS ═══ */
    .timeslot-option {
        padding: 10px !important;
        font-size: 12px !important;
    }

    /* ═══ BUTTONS ═══ */
    .btn {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }

    /* ═══ ROOM CARDS ═══ */
    .room-card {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }

    .room-title {
        font-size: 1em !important;
    }

    .room-image {
        height: 150px !important;
    }

    .room-description {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE (max-width: 480px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* ═══ CALENDAR CONTAINER ═══ */
    .roomavailability-calendar {
        padding: 5px !important;
    }

    .calendar-wrapper {
        padding: 8px !important;
        border-radius: 4px !important;
    }

    /* ═══ CALENDAR NAVIGATION ═══ */
    .calendar-navigation {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .calendar-month-header {
        font-size: 1em !important;
        order: 1 !important;
    }

    .nav-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .nav-btn:first-child {
        order: 2 !important;
    }

    .nav-btn:last-child {
        order: 3 !important;
    }

    /* ═══ CALENDAR TABLE ═══ */
    .calendar-table {
        font-size: 9px !important;
    }

    .calendar-table th {
        padding: 5px 2px !important;
        font-size: 9px !important;
    }

    /* Skrati nazive dana na mobile */
    .calendar-table th {
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    /* ═══ CALENDAR DAYS ═══ */
    .calendar-day {
        padding: 3px !important;
        min-height: 50px !important;
    }

    .day-number {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    .day-slots,
    .available-slots {
        font-size: 7px !important;
        margin-top: 2px !important;
        line-height: 1.2 !important;
    }

    /* ═══ FULLY BOOKED - Još manji krug ═══ */
    .calendar-day.fully-booked::before {
        font-size: 14px !important;
        width: 22px !important;
        height: 22px !important;
        top: 3px !important;
        right: 3px !important;
    }

    .calendar-day.fully-booked .available-slots {
        font-size: 7px !important;
    }

    .calendar-day.fully-booked .day-number {
        font-size: 10px !important;
    }

    /* ═══ CALENDAR LEGEND ═══ */
    .calendar-legend {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .legend-item {
        font-size: 10px !important;
    }

    .legend-color {
        width: 16px !important;
        height: 16px !important;
    }

    /* ═══ MODAL FULL SCREEN ═══ */
    .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        height: 100vh !important;
    }

    .modal-content {
        border-radius: 0 !important;
        height: 100% !important;
    }

    .modal-header,
    .modal-footer {
        border-radius: 0 !important;
    }

    .modal-title {
        font-size: 1em !important;
    }

    /* ═══ TIMESLOT OPTIONS ═══ */
    .timeslot-option {
        padding: 8px !important;
        font-size: 11px !important;
    }

    /* ═══ BUTTONS ═══ */
    .btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }

    /* ═══ ROOM CARDS ═══ */
    .room-card {
        padding: 10px !important;
        margin-bottom: 12px !important;
    }

    .room-title {
        font-size: 0.95em !important;
    }

    .room-image {
        height: 120px !important;
    }

    .room-description {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    /* ═══ FORM ELEMENTS ═══ */
    .form-control {
        font-size: 16px !important; /* iOS zahteva min 16px da ne zum-ira automatski */
        padding: 10px !important;
    }

    .form-group label {
        font-size: 13px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   EXTRA SMALL (max-width: 360px) - Za veoma male telefone
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {

    .calendar-month-header {
        font-size: 0.9em !important;
    }

    .calendar-table th {
        font-size: 8px !important;
        padding: 4px 1px !important;
    }

    .calendar-day {
        padding: 2px !important;
        min-height: 45px !important;
    }

    .day-number {
        font-size: 10px !important;
    }

    .day-slots,
    .available-slots {
        font-size: 6px !important;
    }

    .calendar-day.fully-booked::before {
        font-size: 12px !important;
        width: 20px !important;
        height: 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE MODE (portrait mode override)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {

    .modal-dialog {
        max-height: 90vh !important;
        height: auto !important;
    }

    .calendar-day {
        min-height: 50px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH-FRIENDLY IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Veći tap targets (min 44x44px za pristupačnost) */
    .calendar-day {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .nav-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .btn {
        min-height: 44px !important;
    }

    /* Sprečava "tap highlight" na iOS */
    .calendar-day,
    .nav-btn,
    .btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }

    /* Omogućava smooth scrolling */
    .modal-body {
        -webkit-overflow-scrolling: touch !important;
    }
}
.calendar-legend { align-items: center; }
.legend-item { align-items: center; }
.legend-color { flex-shrink: 0; }

/* Vertikalno poravnanje legende na mobilnim uređajima */

@media (max-width: 480px) {
    .calendar-legend {
        flex-direction: column !important; /* Ređa stavke jednu ispod druge */
        align-items: flex-start !important; /* Poravnava ih uz levu ivicu */
        gap: 12px !important;              /* Pravi razmak između redova */
        padding-left: 20px !important;     /* Malo uvlači celu legendu desno */
    }

    .legend-item {
        display: flex !important;
        align-items: center !important;    /* Centrira kvadratić u odnosu na tekst */
        width: 100% !important;
        font-size: 13px !important;
    }

    .legend-color {
        width: 20px !important;            /* Malo veći kvadratić za bolju vidljivost */
        height: 20px !important;
        margin-right: 10px !important;     /* Razmak između kvadratića i teksta */
        flex-shrink: 0 !important;         /* Sprečava da se kvadratić deformiše */
    }
    /* Efekat povećanja dok korisnik drži prst na datumu (Tap & Hold) */
    .calendar-day:not(.empty-day):not(.past):not(.fully-booked):active {
        transform: scale(1.10) !important; /* Malo veće nego na desktopu da se vidi pod prstom */
        z-index: 10;                        /* Izdiže ga iznad ostalih da se ne seku ivice */
        background-color: #e6f3ff !important;
        border-color: #337ab7 !important;
        transition: transform 0.1s ease;    /* Brža reakcija na dodir */
    }

    /* Opciono: Efekat nakon što je datum izabran (ako ostaje fokusiran) */
    .calendar-day:focus {
        transform: scale(1.05);
        outline: none;
    }
}
/* ── Timeslot lista u modalu: donut krug + info ── */
.timeslot-option.rac-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 6px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
    text-align: left;
}
.timeslot-option.rac-slot.available:hover {
    background: #f0f7ff;
    border-color: #0d6efd;
}
.timeslot-option.rac-slot.past,
.timeslot-option.rac-slot.unavailable {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
/* Horizontalna traka popunjenosti u listi timeslotova */
.rac-slot-bar {
    width: 52px;
    height: 28px;
    border-radius: 5px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.12);
}
.rac-slot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.rac-slot-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}
.rac-slot-spots {
    font-size: 0.78rem;
    color: #198754;
    font-weight: 600;
}
.rac-slot-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}
.rac-slot-badge.available { background: #d1e7dd; color: #0a3622; }
.rac-slot-badge.full      { background: #f8d7da; color: #58151c; }
.rac-slot-badge.past      { background: #e9ecef; color: #6c757d; }

/* ── Hover tooltip na datumima kalendara ── */
.rac-quick-tooltip {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
    padding: 10px 14px;
    min-width: 200px;
    max-width: 270px;
    pointer-events: none;
    font-size: 0.82rem;
    line-height: 1.4;
    animation: rac-tt-in 0.12s ease;
}
@keyframes rac-tt-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rac-tt-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: #212529;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}
.rac-tt-loading, .rac-tt-empty {
    color: #6c757d;
    text-align: center;
    padding: 4px 0;
}
.rac-tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.rac-tt-row.past    { opacity: 0.4; }
.rac-tt-row.unavail { opacity: 0.6; }
.rac-tt-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.85);
}
.rac-tt-name {
    flex: 1;
    font-weight: 500;
    color: #343a40;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rac-tt-spots {
    font-size: 0.75rem;
    color: #198754;
    font-weight: 600;
    white-space: nowrap;
}
.rac-tt-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.rac-tt-tag.avail { background: #d1e7dd; color: #0a3622; }
.rac-tt-tag.full  { background: #f8d7da; color: #58151c; }
.rac-tt-tag.past  { background: #e9ecef; color: #6c757d; }

/* ── Mobile: "← Nazad" link u modal headeru ── */
.modal-back-link {
    display: none; /* sakriven na desktopu */
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}
.modal-back-link:hover { color: #0d6efd; text-decoration: none; }

@media (max-width: 768px) {
    .modal-back-link {
        display: flex; /* vidljivo samo na mobilnom */
    }
    .modal-header {
        flex-wrap: wrap;
        gap: 4px;
    }
    .modal-title {
        order: 2;
        flex: 1 1 100%;
        font-size: 1em !important;
        margin-top: 2px;
    }
    .modal-back-link { order: 1; }
    .btn-close { order: 3; }
}

/* ── Trake dostupnosti po terminu unutar datumske ćelije ── */

/* Overlay koji prekriva cijelu ćeliju — ne dira padding ni visinu */
.rac-strips-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Svaka traka = jedan timeslot, razdvojena bijelom linijom */
.rac-strip-bar {
    flex: 1;
    min-height: 0;
}
.rac-strip-bar + .rac-strip-bar {
    border-top: 2px solid #fff;
}

/* Tekst ćelije (broj dana, status) leži IZNAD overlaya */
td.calendar-day .day-number,
td.calendar-day .day-slots {
    position: relative;
    z-index: 1;
}

.rac-tt-icon { font-size: 0.85rem; flex-shrink: 0; }

/* ── Responsive: timeslot bars u datumskim ćelijama ──
   Inline stil koristi height:38px — override sa !important na mobilnim ekranima */
@media (max-width: 480px) {
    .rac-day-bars {
        height: 26px !important;
        padding: 2px !important;
        gap: 1px !important;
    }
}
@media (max-width: 360px) {
    .rac-day-bars {
        height: 20px !important;
        padding: 1px !important;
        gap: 1px !important;
    }
}

/* ── Touch uređaji: aktivni datum vizualni feedback ── */
@media (hover: none) {
    /* Na touch-u nema hover efekta, ali active (tap) daje feedback */
    .room-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        transition: transform 0.1s ease;
    }
    /* Tooltip (hover-only) sakrijemo na touch uređajima */
    .rac-quick-tooltip {
        display: none !important;
    }
}
