/* public/css/calendar.css */

.calendar-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.calendar-header h4 {
    margin: 0;
    font-size: 1.5rem;
}

.calendar-nav button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    margin: 0 5px;
}

.calendar-nav button:hover {
    background-color: #0056b3;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.month {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.month-header {
    text-align: center;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    padding-top: 1rem;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #eee;
}

.days-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: relative; /* This is important for the leave bars */
}

.day-name {
    font-weight: bold;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    padding: 0.5rem 0;
}

.day {
    border-right: 1px solid #eee;
    border-top: 1px solid #eee;
    padding: 4px;
    position: relative;
}

.day:nth-child(7n) {
    border-right: none;
}

.day-number {
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 24px;
    width: 24px;
    height: 24px;
    text-align: center;
    margin: 0 auto;
}

.day.is-today .day-number {
    background-color: #ffc107;
    color: #fff;
    border-radius: 50%;
}

.day.not-in-month {
    background-color: #f8f9fa;
}

/* --- Manager View Specific Styles --- */
.manager-view .day {
    min-height: 50px; /* A default small height for empty weeks */
}

.leave-bar {
    position: absolute;
    height: 22px;
    line-height: 22px;
    padding: 0 8px;
    font-size: 0.8rem;
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    z-index: 1;
    box-sizing: border-box;
}

.leave-bar.no-start-cap { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.leave-bar.no-end-cap { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.leave-bar.approved { background-color: #28a745; }
.leave-bar.pending { background-color: #fd7e14; }
.leave-bar.rejected { background-color: #6c757d; } /* Grey for rejected */
.leave-bar:hover { z-index: 2; filter: brightness(1.1); }


/* --- Employee View Specific Styles --- */
.employee-view .day {
    min-height: 40px; /* Much smaller cells */
    display: flex;
    align-items: center;
    justify-content: center;
}

.employee-view .day-indicator {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.day-indicator.approved { background-color: #d4edda; }
.day-indicator.pending { background-color: #fff3cd; }
.day-indicator.rejected { background-color: #e2e3e5; } /* Light grey */


/* --- Legend Styles --- */
.calendar-legend {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.legend-approved { background-color: #28a745; }
.legend-pending { background-color: #fd7e14; }
.legend-rejected { background-color: #6c757d; }
.legend-today {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffc107;
}

/* Add these new rules to your calendar.css file */

.day.is-weekend {
    background-color: #e9ecef; /* Slightly darker grey */
}

.day.is-holiday .day-number {
    font-weight: bold;
    color: #dc3545; /* Red for holiday numbers */
}

.day.is-holiday {
    cursor: help; /* Change cursor to indicate a tooltip is available */
}