﻿/* dashboard.css - fully responsive version */

/* ---------- Dashboard grid layout ---------- */
.dashboard {
    grid-area: dashboard;
    padding: 0.5rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
    align-items: start;
    min-height: 0;
}

    /* Columns */
    .dashboard .col1,
    .dashboard .col2,
    .dashboard .col3 {
        display: grid;
        gap: 1.5rem;
        min-height: 0;
        max-width:100%;
        grid-column: auto;
        height:100%;
        grid-row: auto;
    }

/* Column stack layout */
.col-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    min-height: 0;
}

/* Dash card styling */
.dash-card {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    box-shadow: 0 4px 4px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 1.5rem;
    text-align: center;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

    .dash-card:hover {
        /* Optional hover effect
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 8px rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.35);
    */
    }

.dash-canvas {

    width: 100%;
    max-height: 300px;
    max-width:100%;
    height: 300px;
    flex: 0 0 auto;
}

/* Table-style card */
.upcoming-fade {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 4px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 0;
}

    .upcoming-fade:hover {
        /* Optional hover effect
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 8px rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.35);
    */
    }

    .upcoming-fade .mud-table-root {
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

/* Calendar container */
#upcomingRegsCalendar {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;

}

.col3 .dash-card {
    overflow: visible !important;
    min-height: 0;
}

/* Event styling */
#upcomingRegsCalendar .fc-event, #upcomingRegsCalendar .fc-daygrid-event {
    font-size: 0.85rem;
    line-height: 1.1;
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
    box-sizing: border-box;
}

    #upcomingRegsCalendar .fc-daygrid-event .fc-event-title,
    #upcomingRegsCalendar .fc-daygrid-event .fc-event-time {
        display: block;
        font-size: 0.7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #upcomingRegsCalendar .fc-daygrid-event .fc-event-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

#upcomingRegsCalendar .fc-daygrid-event {
    min-height: 1.6em;
    max-height: 3.2em;
}

#upcomingRegsCalendar .fc-event-time {
    font-size: 0.5rem;
    opacity: 0.85;
}

/* Tooltip */
.fc-custom-tooltip {
    position: fixed;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    max-width: 260px;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    line-height: 1.2;
    white-space: pre-wrap;
}

/* Drag helper */
.fc-event-dragging, .fc-event.fc-event-dragging, .fc-event-dragging .fc-event, .fc-dragging {
    position: fixed !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

body.fc-drag-active {
    overflow-x: hidden;
}

.fc-body-mirror-clone {
    transition: none !important;
    transform: none !important;
    will-change: left, top;
}

/* Responsive tweaks for smaller screens */
@media(max-width:992px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

        .dashboard .col1, .dashboard .col2, .dashboard .col3 {
            display: block;
        }

    .col-stack {
        grid-template-rows: auto;
    }

    .dash-canvas {
        height: 220px;
        max-height: 220px;
    }
}

/* Highlight today in calendar */
.fc-day-today {
    background-color: #edecf9 !important;
}

    .fc-day-today .fc-daygrid-day-number {
        color: #000000 !important;
    }

    .fc-day-today:hover {
        background-color: #FDD835 !important;
    }

/* Toolbar title size */
.fc .fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 500;
}

.fc-custom-legend {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin: 0.2rem 0 0.6rem 0; /* spacing under header */
    font-size: 0.9rem;
    font-weight: 600;
}

    .fc-custom-legend .legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .fc-custom-legend .legend-color {
        width: 14px;
        height: 14px;
        border-radius: 4px;
        display: inline-block;
    }


/* ---------- MOBILE FIX FOR FULLCALENDAR LEGEND ---------- */
@media (max-width: 600px) {
    .fc-header-toolbar {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 0.4rem !important;
    }

    .fc-custom-legend {
        width: 100%;
        justify-content: center;
        gap: 1.2rem;
        margin-top: 0.4rem;
    }

        .fc-custom-legend .legend-item {
            font-size: 0.85rem;
        }
}

/* TODAY button */
.fc .fc-today-button {
    background: #244DBD !important; /* background color */
    color: white !important; /* text color */
    border: none !important;
}

    /* Disabled Today button (when already on today) */
    .fc .fc-today-button.fc-button-disabled {
        background: #9aa3b1 !important;
        opacity: 0.6;
    }


/* PREV & NEXT arrow buttons */
.fc .fc-prev-button,
.fc .fc-next-button {
    background: #244DBD !important;
    color: white !important;
    border: none !important;
}

    /* Hover effect */
    .fc .fc-prev-button:hover,
    .fc .fc-next-button:hover {
        background: #273b58 !important;
        border:none !important;
    }


/* Remove border, outline, and focus ring for all header buttons */
.fc .fc-button,
.fc .fc-button:focus,
.fc .fc-button:active,
.fc .fc-button:focus-visible {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}


/* Keyframes: show → hide → show */
