/**
 * Cronos Room Availability - Styles con visualizzazione grid mobile
 */

/* Container principale */
#cronos-availability-widget {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Navigazione calendario */
.cronos-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.cronos-current-date {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
}

.cronos-day-name {
    font-size: 18px;
    opacity: 0.8;
}

.cronos-day-num {
    font-size: 32px;
    font-weight: 700;
    color: #a78bfa;
}

.cronos-month-name {
    font-size: 18px;
    opacity: 0.8;
}

.cronos-today-badge {
    padding: 4px 12px;
    background: #10b981;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.cronos-nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cronos-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.cronos-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Legenda */
.cronos-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.cronos-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb;
    font-size: 12px;
}

.cronos-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* Stati colori */
.cronos-status-disponibile {
    background: #10b981;
}

.cronos-status-occupato {
    background: #ef4444;
}

.cronos-status-chiuso {
    background: #6b7280;
}

.cronos-status-orari-limitati {
    background: #f59e0b;
}

/* Mobile View - Stessa struttura del desktop */
.cronos-rooms-mobile {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cronos-table-mobile {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    min-width: 600px;
}

.cronos-table-mobile thead th {
    padding: 8px 4px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.cronos-table-mobile thead th:first-child {
    text-align: left;
    padding-left: 8px;
    border-radius: 8px 0 0 8px;
    width: 80px;
    min-width: 80px;
}

.cronos-table-mobile thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.cronos-table-mobile tbody td {
    padding: 2px;
    text-align: center;
}

.cronos-table-mobile .cronos-room-name-cell {
    padding: 8px !important;
    text-align: left !important;
    background: #1a1a2e;
    border-radius: 8px 0 0 8px;
    position: sticky;
    left: 0;
    z-index: 5;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

.cronos-room-mobile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cronos-room-mobile-content.clickable-room {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cronos-room-mobile-content.clickable-room:active {
    opacity: 0.7;
}

.cronos-room-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(167, 139, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cronos-room-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cronos-room-initials {
    color: #a78bfa;
    font-weight: 700;
    font-size: 14px;
}

.cronos-room-label-mobile {
    color: white;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    max-width: 80px;
    word-break: break-word;
}

/* Slot mobile */
.cronos-table-mobile .cronos-slot {
    padding: 12px 4px;
    margin: 0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
}

.cronos-table-mobile .cronos-slot.clickable {
    cursor: pointer;
}

.cronos-table-mobile .cronos-slot.clickable:active {
    transform: scale(0.95);
}

/* Icone status per mobile */
.cronos-table-mobile .cronos-slot::before {
    font-size: 16px;
}

.cronos-table-mobile .cronos-slot.cronos-status-disponibile::before {
    content: "✓";
}

.cronos-table-mobile .cronos-slot.cronos-status-occupato::before {
    content: "✗";
}

.cronos-table-mobile .cronos-slot.cronos-status-chiuso::before {
    content: "—";
}

.cronos-table-mobile .cronos-slot.cronos-status-orari-limitati::before {
    content: "🕒";
}

/* Desktop View */
.cronos-rooms-desktop {
    display: none;
}

.cronos-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.cronos-table thead th {
    padding: 12px 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
}

.cronos-table thead th:first-child {
    text-align: left;
    border-radius: 8px 0 0 8px;
}

.cronos-table thead th:last-child {
    border-radius: 0 8px 8px 0;
}

.cronos-table tbody td {
    padding: 4px;
    text-align: center;
}

.cronos-room-name-cell {
    padding: 12px 16px !important;
    color: white;
    font-weight: 700;
    text-align: left !important;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 0 0 8px;
}

.cronos-room-desktop-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cronos-room-desktop-content.clickable-room {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cronos-room-desktop-content.clickable-room:hover {
    opacity: 0.8;
}

.cronos-room-desktop-content .cronos-room-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.cronos-table .cronos-slot {
    padding: 8px;
    margin: 0;
    text-align: center;
    font-size: 12px;
    border-radius: 6px;
}

.cronos-table .cronos-slot.clickable {
    cursor: pointer;
}

.cronos-table .cronos-slot.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Loading e errori */
.cronos-loading,
.cronos-error,
.cronos-no-data {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 16px;
}

.cronos-error {
    color: #ef4444;
}

/* Responsive - Tablet */
@media (min-width: 640px) {
    .cronos-room-label-mobile {
        font-size: 10px;
    }
    
    .cronos-table-mobile thead th {
        font-size: 12px;
    }
    
    .cronos-legend-item {
        font-size: 13px;
    }
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    #cronos-availability-widget {
        padding: 32px;
    }
    
    .cronos-rooms-mobile {
        display: none;
    }
    
    .cronos-rooms-desktop {
        display: block;
    }
    
    .cronos-calendar-nav {
        padding: 20px 24px;
    }
    
    .cronos-legend {
        padding: 20px;
        gap: 16px;
    }
    
    .cronos-legend-item {
        font-size: 14px;
    }
    
    .cronos-legend-color {
        width: 16px;
        height: 16px;
        border-radius: 4px;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cronos-table-mobile {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizzata */
.cronos-rooms-mobile::-webkit-scrollbar {
    height: 6px;
}

.cronos-rooms-mobile::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cronos-rooms-mobile::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.5);
    border-radius: 3px;
}

.cronos-rooms-mobile::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.7);
}

/* Print styles */
@media print {
    #cronos-availability-widget {
        background: white;
        color: black;
    }
    
    .cronos-nav-btn {
        display: none;
    }
    
    .cronos-rooms-mobile {
        overflow-x: visible;
    }
}