/**
 * GBI Booking Calendar Styles
 * Beautiful, responsive calendar component
 */

/* ===== Calendar Container ===== */
.gbi-booking-calendar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ===== Month Navigation ===== */
.gbi-calendar-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.gbi-nav-button {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gbi-nav-button:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.gbi-nav-button:active {
    transform: translateY(0);
}

.gbi-nav-prev span::before {
    content: ' Previous';
    margin-left: 8px;
}

.gbi-nav-next span::after {
    content: 'Next ';
    margin-right: 8px;
}

/* ===== Loading State ===== */
.gbi-calendar-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gbi-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: gbi-spin 0.8s linear infinite;
}

@keyframes gbi-spin {
    to { transform: rotate(360deg); }
}

/* ===== Month Container ===== */
.gbi-calendar-month {
    margin-bottom: 30px;
}

.gbi-calendar-month:last-of-type {
    margin-bottom: 0;
}

.gbi-calendar-header {
    text-align: center;
    margin-bottom: 15px;
}

.gbi-calendar-header h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

/* ===== Calendar Grid ===== */
.gbi-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.gbi-calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 0;
}

/* ===== Calendar Days ===== */
.gbi-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #f9fafb;
    border: 2px solid transparent;
}

.gbi-calendar-day:not(.gbi-calendar-day-empty):not(.gbi-calendar-day-past):not(.gbi-calendar-day-blocked):hover {
    background: #f0fdfa;
    border-color: #0d9488;
    transform: scale(1.05);
}

.gbi-calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

/* ===== Day States ===== */
.gbi-calendar-day-empty {
    background: transparent;
    cursor: default;
}

.gbi-calendar-day-past {
    background: #f3f4f6;
    cursor: not-allowed;
}

.gbi-calendar-day-past .gbi-calendar-day-number {
    color: #9ca3af;
}

.gbi-calendar-day-blocked {
    background: repeating-linear-gradient(
        45deg,
        #fee2e2,
        #fee2e2 5px,
        #fecaca 5px,
        #fecaca 10px
    );
    cursor: not-allowed;
    position: relative;
}

.gbi-calendar-day-blocked .gbi-calendar-day-number {
    color: #991b1b;
}

.gbi-calendar-day-blocked::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
}

.gbi-calendar-day-today {
    border-color: #0d9488;
    font-weight: 700;
}

.gbi-calendar-day-today .gbi-calendar-day-number {
    color: #0d9488;
}

/* ===== Selected Dates ===== */
.gbi-calendar-day-checkin,
.gbi-calendar-day-checkout {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border-color: #0d9488;
}

.gbi-calendar-day-checkin .gbi-calendar-day-number,
.gbi-calendar-day-checkout .gbi-calendar-day-number {
    color: white;
    font-weight: 700;
}

.gbi-calendar-day-checkin::before {
    content: 'IN';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    color: white;
    opacity: 0.8;
}

.gbi-calendar-day-checkout::before {
    content: 'OUT';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 700;
    color: white;
    opacity: 0.8;
}

.gbi-calendar-day-in-range {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.gbi-calendar-day-in-range .gbi-calendar-day-number {
    color: #065f46;
}

/* ===== Calendar Summary ===== */
.gbi-calendar-summary {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.gbi-calendar-hint {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
    margin: 0;
}

.gbi-selected-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gbi-selected-date {
    background: #f0fdfa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #0d9488;
}

.gbi-date-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.gbi-date-value {
    display: block;
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}

.gbi-calendar-summary-complete {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #0d9488;
    margin-top: 30px;
}

.gbi-clear-dates {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.gbi-clear-dates:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* ===== Legend ===== */
.gbi-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
}

.gbi-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gbi-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #e5e7eb;
}

.gbi-legend-color.available {
    background: #f9fafb;
}

.gbi-legend-color.blocked {
    background: repeating-linear-gradient(
        45deg,
        #fee2e2,
        #fee2e2 3px,
        #fecaca 3px,
        #fecaca 6px
    );
}

.gbi-legend-color.selected {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .gbi-booking-calendar {
        padding: 15px;
    }

    .gbi-calendar-grid {
        gap: 2px;
    }

    .gbi-calendar-day {
        border-radius: 4px;
    }

    .gbi-calendar-day-number {
        font-size: 12px;
    }

    .gbi-calendar-day-header {
        font-size: 10px;
        padding: 8px 0;
    }

    .gbi-selected-dates {
        grid-template-columns: 1fr;
    }

    .gbi-calendar-header h3 {
        font-size: 16px;
    }

    /* Mobile navigation buttons */
    .gbi-nav-button {
        padding: 10px 15px;
        font-size: 16px;
    }

    .gbi-nav-prev span::before {
        content: '';
        margin-left: 0;
    }

    .gbi-nav-next span::after {
        content: '';
        margin-right: 0;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .gbi-booking-calendar {
        background: #1f2937;
    }

    .gbi-calendar-header h3 {
        color: #f9fafb;
    }

    .gbi-calendar-day {
        background: #374151;
    }

    .gbi-calendar-day-number {
        color: #f9fafb;
    }

    .gbi-calendar-day-past {
        background: #4b5563;
    }

    .gbi-selected-date {
        background: #065f46;
    }

    .gbi-date-value {
        color: #f9fafb;
    }
}

/* ===== Print Styles ===== */
@media print {
    .gbi-clear-dates {
        display: none;
    }

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