/* ========== VARIABLES I RESET ========== */
:root {
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-bg: #f8fafc;
    --color-sidebar: #ffffff;
    --color-card: #ffffff;
    --shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
    --border-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', system-ui, sans-serif;
    background: var(--color-bg);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1e293b;
}

/* ========== CAPÇALERA ========== */
header {
    background: var(--color-primary);
    color: white;
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.header-info h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-info p {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Botón login en header */
.login-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--color-primary);
    padding: 0.9rem 1.2rem;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.login-link-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.login-link-btn svg {
    stroke: var(--color-primary);
}

.room-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.6rem 1.8rem;
    border-radius: 40px;
    font-size: 1.5rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* ========== LAYOUT PRINCIPAL ========== */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

/* --- SIDEBAR --- */
aside {
    width: 260px;
    background: var(--color-sidebar);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.sala-btn {
    background: white;
    border: 2px solid #e2e8f0;
    color: #1e293b;
    padding: 18px 12px;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    letter-spacing: 0.3px;
    width: 80%;
    margin: auto;
}

.sala-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.sala-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 8px 16px -6px rgba(37, 99, 235, 0.4);
}

#loading-sales {
    color: #64748b;
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
}

/* --- CONTINGUT --- */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.view-panel {
    display: none;
    width: 100%;
    height: 100%;
}

.view-panel.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#view-home {
    justify-content: center;
    align-items: center;
    background: #eef2ff;
    border-radius: var(--border-radius);
}

#view-home img {
    max-width: 90%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 24px;
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.15);
}

/* Panell del calendari */
.calendar-panel {
    background: var(--color-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    flex: 3;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.calendar-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #0f172a;
}

.view-toggles {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn.active-view {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Targeta propera activitat */
.next-event-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 20px 28px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.next-event-label {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.next-event-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.next-event-details {
    display: flex;
    gap: 30px;
    font-size: 1.2rem;
    opacity: 0.9;
}

.next-event-details span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.no-events-message {
    font-size: 1.5rem;
    opacity: 0.8;
    font-style: italic;
}

/* FullCalendar personalització */
.fc {
    --fc-border-color: #e2e8f0;
    --fc-button-bg-color: #f1f5f9;
    --fc-button-border-color: #cbd5e1;
    --fc-button-text-color: #1e293b;
    --fc-button-hover-bg-color: #e2e8f0;
    --fc-button-active-bg-color: var(--color-primary);
    --fc-button-active-border-color: var(--color-primary);
    --fc-today-bg-color: #eff6ff;
}

.fc .fc-toolbar-title {
    font-size: 1.4rem !important;
    font-weight: 600;
}

.fc .fc-button {
    padding: 0.4rem 1rem !important;
    font-weight: 500;
    border-radius: 40px !important;
}

.fc-daygrid-event {
    border-radius: 30px !important;
    padding: 4px 8px !important;
    font-weight: 500;
    font-size: 0.9rem;
}



#dynamic-views {
    width: 100%;
    height: 100%;
}

/* Eliminar qualsevol restricció d'alçada mínima que pugui interferir */
.view-panel {
    height: 100%;
}







/* ========== MODAL D'ACTIVITAT ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    padding: 28px 32px;
    position: relative;
    animation: slideUp 0.25s ease;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    line-height: 1.3;
    padding-right: 30px;
}

.modal-datetime {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    color: #475569;
    font-size: 1.1rem;
}

.modal-datetime i {
    margin-right: 10px;
    opacity: 0.7;
}

.modal-description {
    background: #f8fafc;
    padding: 18px 20px;
    border-radius: 20px;
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 24px;
    border-left: 4px solid var(--color-primary, #2563eb);
}

.modal-close-btn {
    background: var(--color-primary, #2563eb);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 60px;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 8px 16px -6px rgba(37, 99, 235, 0.3);
}

.modal-close-btn:hover {
    background: #1d4ed8;
    transform: scale(0.98);
}

.modal-close-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.15s;
    padding: 4px 8px;
    border-radius: 40px;
}

.modal-close-icon:hover {
    color: #0f172a;
    background: #f1f5f9;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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



.sala-btn.active {
    transform: scale(1.20);
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.2);
    z-index: 2;
    transition: all 0.2s ease;
}



/* ========== RESPONSIVE 800x480 ========== */
@media (max-width: 900px) and (max-height: 600px) {

    body {
        font-size: 12px;
    }

    header {
        padding: 0.6rem 1rem;
    }

    .header-info h1 {
        font-size: 1.4rem;
    }

    .header-info p {
        font-size: 0.8rem;
    }

    .room-badge {
        font-size: 0.9rem;
        padding: 0.3rem 1rem;
    }

    .login-link-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    main {
        padding: 8px;
        gap: 8px;
    }

    aside {
        width: 150px;
        padding: 10px 6px;
        gap: 6px;
    }

    .sala-btn {
        font-size: 0.8rem;
        padding: 10px 6px;
        border-radius: 30px;
    }

    .content {
        gap: 8px;
    }

    #view-home p {
        font-size: 1rem !important;
    }

    #view-home img {
        max-height: 50%;
    }

    .calendar-panel {
        padding: 10px;
    }

    .calendar-header h2 {
        font-size: 1rem;
    }

    .view-btn {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .next-event-card {
        padding: 10px 14px;
    }

    .next-event-title {
        font-size: 1.2rem;
    }

    .next-event-details {
        font-size: 0.8rem;
        gap: 10px;
    }

    /* FullCalendar compacte */
    .fc .fc-toolbar-title {
        font-size: 0.9rem !important;
    }

    .fc .fc-button {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    .fc-daygrid-event {
        font-size: 0.7rem !important;
        padding: 2px 4px !important;
    }

    a#login-link-btn {
        display: none;
    }

}

