/* Web Calendar Event - Monthly Calendar Styles */

.wce-monthly-calendar-wrapper {
    position: relative;
    font-family: sans-serif;
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    overflow-x: auto;
}

.wce-monthly-calendar-wrapper.wce-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Header: Nav + Title */
.wce-monthly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.wce-monthly-title {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex-grow: 1;
    white-space: nowrap;
}

.wce-monthly-nav {
    font-size: 0.9em;
    color: #0073aa;
    cursor: pointer;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 3px;
    user-select: none;
    white-space: nowrap;
}

.wce-monthly-nav:hover {
    background: #f0f0f0;
}

/* --- NEW: Active state --- */
.wce-monthly-nav:active {
    background: #e0e0e0;
    transform: translateY(1px);
}


/* Calendar Table */
.wce-monthly-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Equal column widths */
}

.wce-monthly-calendar th {
    background: #f0f0f0;
    font-weight: bold;
    padding: 8px 5px;
    text-align: center;
    font-size: 0.9em;
    border: 1px solid #ddd;
    color: #555;
}

.wce-monthly-calendar td {
    height: 120px; /* Day cell height */
    border: 1px solid #ddd;
    vertical-align: top;
    padding: 0;
    background: #fff;
    position: relative;
}

.wce-day-other-month {
    background: #f5f5f5;
    opacity: 0.7;
}

.wce-day-number {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    padding: 5px;
    text-align: right;
}

.wce-day-today {
    background-color: #fffde7;
}
.wce-day-today .wce-day-number {
    color: #000;
    font-weight: bold;
    background: #fecb00;
    display: inline-block;
    padding: 3px 6px;
    border-radius: 0 0 0 5px;
    position: absolute;
    top: 0;
    right: 0;
}


/* Events inside cells */
.wce-day-events {
    padding: 0 5px 5px;
    overflow-y: auto;
    max-height: 85px; /* (Cell height - day number) */
}

.wce-event-item {
    font-size: 0.85em;
    padding: 3px 5px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 3px;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wce-event-item.special-red {
    background: #ffebee;
    border-left: 3px solid #D32F2F;
    color: #D32F2F;
}

.wce-event-item.special-green {
    background: #e8f5e9;
    border-left: 3px solid #388E3C;
    color: #388E3C;
}


/* --- Dark Theme --- */
.wce-theme-dark {
    background: #0a2240;
    border-color: #3a4b64;
    color: #f0f0f0;
}

.wce-theme-dark .wce-monthly-title {
    color: #f0f0f0;
}

.wce-theme-dark .wce-monthly-nav {
    color: #fecb00;
}
.wce-theme-dark .wce-monthly-nav:hover {
    background: #3a4b64;
}
/* --- NEW: Active state dark --- */
.wce-theme-dark .wce-monthly-nav:active {
    background: #1a365c;
    transform: translateY(1px);
}

.wce-theme-dark .wce-monthly-calendar th {
    background: #1a365c;
    border-color: #3a4b64;
    color: #f0f0f0;
}

.wce-theme-dark .wce-monthly-calendar td {
    background: #0f284a;
    border-color: #3a4b64;
}

.wce-theme-dark .wce-day-number {
    color: #ccc;
}

.wce-theme-dark .wce-day-other-month {
    background: #0a2240;
    opacity: 0.7;
}

.wce-theme-dark .wce-day-today {
    background-color: #1a365c;
}
.wce-theme-dark .wce-day-today .wce-day-number {
     background: #fecb00;
     color: #0a2240;
}

.wce-theme-dark .wce-event-item {
    background: #1a365c;
    color: #f0f0f0;
}

.wce-theme-dark .wce-event-item.special-red {
    background: #5a2c2c;
    border-left-color: #ef5350;
    color: #ef5350;
}

.wce-theme-dark .wce-event-item.special-green {
    background: #2a5a2c;
    border-left-color: #66bb6a;
    color: #66bb6a;
}
.wce-monthly-nav:hover {
    background: #f0f0f0;
}

/* --- NEW: Active state --- */
.wce-monthly-nav:active {
    background: #e0e0e0;
    transform: translateY(1px);
}
/* --- UPDATED: Responsive --- */
@media (max-width: 782px) {
    .wce-monthly-header {
        /* Removed flex-direction: column to keep it in one line */
        align-items: stretch; /* Stretch items to be same height */
    }
    .wce-monthly-title {
        font-size: 1.1em;
        order: 0; /* Reset order */
        padding: 5px 0;
    }
    .wce-monthly-calendar th {
        font-size: 0.8em;
        padding: 5px 2px;
    }
    .wce-monthly-calendar td {
        height: 80px;
    }
    .wce-day-number {
        font-size: 0.8em;
        padding: 3px;
    }
    .wce-day-events {
        max-height: 55px;
    }
    .wce-event-item {
        font-size: 0.75em;
        padding: 2px 3px;
    }
    .wce-monthly-nav {
        font-size: 0.8em;
        flex-shrink: 0; /* Don't shrink nav text */
    }
}