/* Importa font semigotici eleganti */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* Reset e configurazioni base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    line-height: 1.6;
    color: #4a4a4a;
    background: linear-gradient(135deg, #f8e1e7 0%, #e8d5c4 50%, #f5f5f5 100%);
    min-height: 100vh;
}

/* Header e navigazione */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(168, 132, 118, 0.15);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #a88476;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #8b6f61;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #4a4a4a;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: linear-gradient(135deg, #a88476, #8b6f61);
    color: white;
    transform: translateY(-2px);
}

/* Container principale */
.container {
    max-width: 1200px;
    margin: 100px auto 0; /* Rimosso margin-bottom */
    padding: 0 2rem;
    padding-bottom: 100px; /* Padding per il footer fisso */
}

/* Container per pagine con contenuto lungo (admin) */
.container-long {
    max-width: 1200px;
    margin: 100px auto 0;
    padding: 0 2rem;
    padding-bottom: 120px; /* Più padding per pagine con tabelle lunghe */
}

/* Footer fisso */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(168, 132, 118, 0.1);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: #a88476;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(168, 132, 118, 0.1);
}

/* Assicura spazio per il footer nelle tabelle */
.table-responsive {
    margin-bottom: 2rem;
}

/* Spazio extra per l'ultimo elemento nelle pagine con contenuto lungo */
.container-long .card:last-child {
    margin-bottom: 2rem;
}

/* Card eleganti */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(168, 132, 118, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(168, 132, 118, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(168, 132, 118, 0.15);
}

/* Form eleganti */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a4a4a;
    font-family: 'Playfair Display', serif;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Bottoni eleganti */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #a88476, #8b6f61);
    color: white;
    font-family: 'Playfair Display', serif;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(168, 132, 118, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #d4a574, #b8860b);
    color: white;
    font-family: 'Playfair Display', serif;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(212, 165, 116, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Stili per pulsanti compatti nelle tabelle */
.btn-compact {
    padding: 0.15rem 0.3rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
    margin: 0;
    border-radius: 0.2rem;
}

/* Container per azioni allineate */
.actions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    justify-content: flex-start;
}

/* Badge compatti */
.badge-compact {
    font-size: 0.75rem !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 0.2rem;
}

/* Form compatto per creazione utente */
.form-compact .form-group {
    margin-bottom: 0;
}

.form-compact .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-compact .form-control {
    height: 32px;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 0.25rem;
}

.form-compact .btn {
    height: 32px;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
}

.form-compact small {
    font-size: 0.7rem;
    margin-top: 0.1rem;
}

/* Grid compatto per form */
.form-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    align-items: end;
}

/* Allineamento specifico per campo password */
.form-compact .password-field {
    display: flex;
    gap: 0.3rem;
    align-items: end;
}

.form-compact .password-field .form-control {
    flex: 1;
}

.form-compact .password-field .btn {
    flex-shrink: 0;
}

/* Allineamento per campo ruolo */
.form-compact .role-field {
    display: flex;
    gap: 0.3rem;
    align-items: end;
}

.form-compact .role-field .form-control {
    flex: 1;
}

.form-compact .role-field .spacer {
    width: 85px;
    height: 32px;
    flex-shrink: 0;
    background: transparent;
}

/* Centratura pulsanti */
.form-compact .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

/* Badge di stato */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-prenotata {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-confermata {
    background: rgba(40, 167, 69, 0.2);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-evasa {
    background: rgba(23, 162, 184, 0.2);
    color: #0c5460;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.status-cancellata {
    background: rgba(220, 53, 69, 0.2);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-user {
    background: rgba(108, 117, 125, 0.2);
    color: #495057;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.status-admin {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-backoffice {
    background: rgba(13, 110, 253, 0.2);
    color: #084298;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.status-non-confermata {
    background: rgba(220, 53, 69, 0.2);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Tabs eleganti */
.tabs {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px 15px 0 0;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab.active {
    background: linear-gradient(135deg, #a88476, #8b6f61);
    color: white;
    font-family: 'Playfair Display', serif;
}

.tab:hover:not(.active) {
    background: rgba(168, 132, 118, 0.1);
    color: #a88476;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabella elegante */
.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.table th {
    background: linear-gradient(135deg, #a88476, #8b6f61);
    color: white;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.table tr:hover {
    background: rgba(168, 132, 118, 0.05);
}

/* Calendario elegante */
.calendar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(168, 132, 118, 0.1);
    border: 1px solid rgba(168, 132, 118, 0.1);
}

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

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
}

.calendar-day {
    background: white !important;
    padding: 0.5rem;
    text-align: left;
    min-height: 100px;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-items: flex-start; /* Allinea gli elementi a sinistra */
}

/* Assicuriamoci che i giorni con prenotazioni non abbiano sfondo colorato */
.calendar-day:not(.today):not(.other-month) {
    background: white !important;
}

.calendar-day:hover {
    background-color: rgba(168, 132, 118, 0.05);
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #4a4a4a;
    position: relative;
    z-index: 2;
    display: block !important;
    visibility: visible !important;
    order: -1; /* Assicura che il numero sia sempre in alto */
}

.reservations-container {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    min-height: 20px;
}

.reservation-strip {
    background: linear-gradient(135deg, #a88476, #8b6f61) !important;
    color: white !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block !important;
    margin-bottom: 0.25rem;
}

.reservation-strip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(168, 132, 118, 0.3);
}

.room-name {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Indicatore per giorni con molte prenotazioni */
.calendar-day.multiple-reservations::after {
    content: '';
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 8px;
    height: 8px;
    background: #d4a574;
    border-radius: 50%;
    border: 2px solid white;
}



.calendar-day.today {
    background: linear-gradient(135deg, #d4a574, #b8860b) !important;
    border: 1px solid #e1e5e9 !important;
}

/* Assicuriamoci che le strisce siano visibili anche sui giorni "today" */
.calendar-day.today .reservation-strip {
    background: linear-gradient(135deg, #a88476, #8b6f61) !important;
    color: white !important;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.calendar-day.today .room-name {
    color: white !important;
    font-weight: 600;
}

/* Assicura che le prenotazioni nei giorni "today" abbiano lo stesso layout */
/* Solo colore testo per il giorno "today" */
.calendar-day.today .day-number {
    color: white !important;
}

.calendar-day.today .room-name {
    color: white !important;
}

/* Indicatore speciale per giorni "today" con prenotazioni - RIMOSSO TEMPORANEAMENTE */
/* .calendar-day.today .reservations-container:not(:empty)::before {
    content: '📅';
    position: absolute;
    top: 0.5rem;
    right: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.7;
    z-index: 1;
} */

/* Alert eleganti */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    color: #2e7d32;
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #c62828;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
    color: #ef6c00;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196f3;
    color: #1565c0;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: 0.8rem;
    }
    
    .calendar-day {
        padding: 0.25rem;
        min-height: 80px;
    }
    
    .day-number {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .reservation-strip {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
    }
    
    .room-name {
        font-size: 0.6rem;
    }
}

/* Animazioni aggiuntive */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(168, 132, 118, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #a88476, #8b6f61);
    color: white;
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body input[readonly] {
    background-color: rgba(168, 132, 118, 0.1);
    color: #4a4a4a;
    font-weight: 500;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
} 