﻿body, html {
    height: 100%;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }



.mud-table-container {
    border-top: 1px solid var(--mud-palette-table-lines);
}

@media(max-width: 600px) {
    .mud-table-toolbar h6 {
        font-size: 1rem;
    }

    .mud-table-toolbar button {
        font-size: 0.7rem;
    }
}

.privacy-policy__link {
    cursor: pointer;
    text-decoration: underline;
}

/* Daily Booking Calendar Styles */
.calendar-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calendar-scroll-container {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    /* Migliora lo scrolling su touch */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    min-width: fit-content;
}

.calendar-header-row {
    display: flex;
    flex-direction: row;
    background-color: var(--mud-palette-grey-lighten3);
    border-bottom: 2px solid var(--mud-palette-divider);
}

.calendar-time-header {
    width: 80px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-right: 2px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

.calendar-venue-header {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-color: var(--mud-palette-primary-lighten5);
    border-right: 1px solid var(--mud-palette-divider);
}

.calendar-time-row {
    display: flex;
    flex-direction: row;
    min-height: 80px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.calendar-time-label {
    width: 80px;
    padding: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-weight: 500;
    background-color: var(--mud-palette-grey-lighten4);
    border-right: 2px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

.calendar-cell {
    flex: 1;
    min-width: 250px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--mud-palette-divider);
    /* Touch support */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.calendar-cell-empty {
    background-color: #e3f2fd;
    cursor: pointer;
    /* Migliora il feedback tattile */
    -webkit-tap-highlight-color: rgba(33, 150, 243, 0.3);
    tap-highlight-color: rgba(33, 150, 243, 0.3);
}

.calendar-cell-unavailable {
    background-color: #f5f5f5;
    color: rgba(0,0,0,0.45);
    opacity: 0.9;
    cursor: not-allowed;
}

.calendar-cell-locked {
    background-color: #fff3e0;
    cursor: not-allowed;
    position: relative;
    opacity: 0.85;
}

.calendar-cell-locked::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 14px;
    opacity: 0.7;
}

.calendar-cell-selected {
    background-color: #bbdefb;
    cursor: pointer;
    border: 2px solid #2196f3;
    /* Animazione per il feedback touch */
    transition: background-color 0.15s ease-in-out;
}

.booking-card {
    width: 100%;
    padding: 5px;
}

.booking-card-pending {
    background-color: #fff3e0;
    border-left: 4px solid #ffb74d;
}

.booking-card-paid {
    background-color: #e8f5e9;
    border-left: 4px solid #66bb6a;
}

.booking-card-cancelled {
    background-color: #ffebee;
    border-left: 4px solid #ef5350;
    opacity: 0.7;
}

.calendar-booking-name {
    font-weight: 500;
}

.calendar-booking-time {
    font-size: 0.75rem;
}

.calendar-booking-chip {
    height: 20px !important;
    font-size: 0.7rem;
}

.calendar-booking-actions button {
    padding: 4px;
}

/* Calendar Legend Styles */
.calendar-legend {
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-divider);
}

.calendar-legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-divider);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-text {
    font-size: 0.875rem;
    white-space: nowrap;
}

.legend-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.legend-available {
    background-color: #e3f2fd;
    border: 1px solid var(--mud-palette-divider);
}

.legend-pending {
    background-color: #fff3e0;
    border-left: 4px solid #ffb74d;
}

.legend-paid {
    background-color: #e8f5e9;
    border-left: 4px solid #66bb6a;
}

.legend-cancelled {
    background-color: #ffebee;
    border-left: 4px solid #ef5350;
    opacity: 0.7;
}

.legend-unavailable {
    background-color: #f5f5f5;
    border: 1px solid var(--mud-palette-divider);
}

.legend-locked {
    background-color: #fff3e0;
    border: 1px solid var(--mud-palette-divider);
    opacity: 0.85;
    position: relative;
    text-align: center;
}

.calendar-selection-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    animation: pulse-scale 0.3s ease-in-out;
}

@keyframes pulse-scale {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .calendar-venue-header {
        min-width: 50px;
    }

    .calendar-time-header {
        width: 55px;
        padding: 5px 0;
    }
    
    .calendar-cell {
        min-width: 55px;
        padding: 5px;
    }
    
    .calendar-booking-name {
        font-size: 0.75rem;
    }

    .calendar-time-label {
        width: 55px;
        padding: 5px 0;
    }
    
    .calendar-booking-time {
        font-size: 0.65rem;
    }
    
    .calendar-booking-chip {
        height: 18px;
        font-size: 0.65rem;
    }
    
    .calendar-booking-actions button {
        padding: 2px;
        min-width: 28px;
    }
}

/* Mobile optimization for legend */
@media (max-width: 600px) {
    .calendar-legend-container {
        gap: 12px;
        justify-content: flex-start;
    }
    
    .calendar-legend-item {
        gap: 6px;
    }
    
    .legend-text {
        font-size: 0.75rem;
    }
}

.date-picker-clickable input {
    text-align: center;
}

.privacy-policy__link {
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

/* Booking Slot Card Styles - Lock Management */

.booking-slot-card {
    transition: all 0.3s ease;
    min-height: 120px;
}

.slot-available {
    cursor: pointer;
}

.slot-available:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slot-locked-by-you {
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(76, 175, 80, 0.5);
    }
}

.slot-unavailable {
    cursor: not-allowed !important;
    pointer-events: none;
}

.slot-selected {
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
}
/* Mobile dialog improvements */
@media (max-width: 960px) {
    .mud-dialog {
        margin: 16px !important;
        max-height: calc(100vh - 32px) !important;
    }

    .mud-dialog-content {
        padding: 16px !important;
        max-height: calc(100vh - 160px) !important;
        overflow-y: auto !important;
    }

    .mud-dialog-actions {
        padding: 12px 16px !important;
    }

    /* Ensure forms inside dialogs are mobile-friendly */
    .mud-dialog .mud-form {
        width: 100%;
    }

    .mud-dialog .mud-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}
