﻿

.calendar-card {
    width: 90%;
    max-width: 1000px;
    background: #fff;
    border: 1px solid #ddd;
    font-family: sans-serif;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    align-items: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #eee;
    overflow-x:scroll;
}

.day-name {
    text-align: center;
    padding: 10px;
    text-transform: uppercase;
    color: #888;
    font-size: 0.9em;
}

.days-contents {
    display: contents; /* Allows children to participate in the parent grid */
}

a.day-cell {
    text-decoration: none;
    color: inherit;
}
.day-cell {
    min-height: 120px;
    min-width:98px;
    border: 0.5px solid #eee;
    padding: 5px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

    .day-cell:hover {
        background: #f9f9f9;
    }

    .day-cell.today {
        background: #fffbe6;
        font-weight: bold;
    }

        .day-cell.today.lock
        {
            background: tomato !important;
        }
        .day-cell.lock {
            background: tomato !important;
        }

    .day-cell.empty {
        background: #fafafa;
    }



.day-number {
    text-align: right;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-item {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.75em;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid #1976d2;
}

.day-cell.lock .event-item {
    background: pink;
    color: red;
    font-size: 0.75em;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid red;
}

/* Today highlight refinement */
.day-cell.today .day-number {
    background: #1976d2;
    color: #fff;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto; /* Keeps it to the right */
}


.day-cell.today.lock .day-number{
    background:pink !important;
    color:red !important;
}

.day-cell.lock .day-number {
    color: pink !important;
}

.day-cell.lock::after,
.day-cell.today.lock::after {
    content: 'NO DISPONIBLE';
    text-align: center;
    color: pink;
    margin: auto;
    padding-bottom: 30px;
    font-weight: bold;
}

.calendar-wrapper {
    display: flex;
    /*gap: 20px;*/
    gap: 10px;
    padding: 20px;
    /*background: #f4f7f6;*/
}

.calendar-sidebar {
    width: 200px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    /*box-shadow: 0 2px 10px rgba(0,0,0,0.05);*/
}

    .calendar-sidebar ul {
        list-style: none;
        padding: 0;
    }

    .calendar-sidebar a,
    .calendar-sidebar li {
        padding: 10px;
        cursor: pointer;
        border-radius: 4px;
        transition: 0.2s;
    }

        .calendar-sidebar a.active,
        .calendar-sidebar li.active {
            background: rgba(var(--bs-primary-rgb));
            color: #fff;
        }

        .calendar-sidebar a.disabled, 
        .calendar-sidebar li.disabled {
            color: #ccc;
            cursor: not-allowed;
            pointer-events: none;
        }

/* Day Cell Disabled State */
.day-cell.disabled {
    background-color: #fcfcfc;
    color: #ddd;
    cursor: not-allowed;
    filter: grayscale(1);
}

    .day-cell.disabled .day-number {
        color: #ddd;
    }


/* --- Mobile Support Overhaul --- */

@media (max-width:1200px){

    .day-cell.lock .event-item {
        display: none;
    }

    /* Hide the "NO DISPONIBLE" text on mobile to save space, use a dot/icon instead */
    .day-cell.lock::after,
    .day-cell.today.lock::after {
        font-size:8px;
    }

}

@media (max-width: 800px) {
    /*Less than 768px*/

    .day-cell{
        min-width:initial;
    }

    .calendar-wrapper {
        flex-direction: column; /* Stack sidebar on top of calendar */
        padding: 10px;
        gap: 15px;
    }

    .calendar-sidebar {
        width: 100%; /* Full width sidebar */
        order: 2; /* Move sidebar below calendar for better UX */
    }

        /* Transform Sidebar list into a horizontal scrollable menu */
        .calendar-sidebar ul {
            display: flex;
            overflow-x: auto;
            gap: 10px;
            padding-bottom: 5px;
            -webkit-overflow-scrolling: touch;
        }

        .calendar-sidebar li {
            white-space: nowrap; /* Prevent month names from wrapping */
            flex-shrink: 0;
            padding: 8px 15px;
            background: #f0f0f0;
        }

    .calendar-card {
        width: 100%;
        max-width: none;
        order: 1;
    }

    .calendar-header h2 {
        font-size: 1.2em;
    }

    /* Adjust Grid for smaller screens */
    .day-cell {
        min-height: 80px; /* Reduce height so more rows fit on screen */
        font-size: 0.8em;
    }

        /* Hide the "NO DISPONIBLE" text on mobile to save space, use a dot/icon instead */
        .day-cell.lock::after,
        .day-cell.today.lock::after {
            content: 'NO DISPONIBLE'; /* Smaller indicator */
            font-size: 0.8em;
            padding-bottom: 5px;
        }

    .day-name {
        font-size: 0.7em;
        padding: 5px;
    }

    /* Optimize events for touch/small view */
    .event-item {
        font-size: 0.65em;
        padding: 1px 3px;
    }
}

/* Extra small devices (Phones in portrait) */
@media (max-width: 480px) { 
    /* Less that 480px */

    .day-cell {
        min-height: 60px;
    }

    .day-number {
        font-size: 0.75em;
    }

    .calendar-header {
        padding: 10px;
    }

 

}