/**
 * Events Calendar Widget Styles
 * Save as: /css/events-calendar-widget.css
 */

.events-calendar-widget {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Removed dropdown controls in favor of header picker */

.calendar-container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.calendar-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #333;
    text-align: center;
    flex: 1;
    cursor: pointer;
}

.nav-btn {
    background: #98041A;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #98041A;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dee2e6;
}

.day-header {
    background: #FFF3CD;
    color: #856404;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.day-cell {
    background: white;
    min-height: 142px;
    padding: 8px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: auto;
}

.day-cell:hover {
    background: #f8f9fa;
    border-color: #98041A;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.day-cell.empty {
    background: #f8f9fa;
    cursor: default;
    pointer-events: none;
}

.day-cell.empty:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.day-cell.today {
    background: #98041A;
    color: white;
}

.day-cell.today .day-number {
    color: white;
    font-weight: bold;
}

.day-cell.today .event-item a {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.day-cell.today:hover {
    background: #98041A;
}

.day-number {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.event-item {
    font-size: 11px;
    line-height: 1.2;
}

.event-item a {
    color: #98041A;
    text-decoration: none;
    display: block;
    padding: 2px 4px;
    border-radius: 3px;
    background: #f4b522;
    transition: all 0.2s ease;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    text-decoration: underline;
    font-size: 15px;
}

.event-item a:hover {
    background: #F4B522;
    transform: scale(1.02);
}

/* Month/Year picker overlay */
.month-year-picker { position: relative; z-index: 10; }
.myp-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.myp-panel { background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); padding: 16px; max-width: 560px; width: 100%; }
.myp-years, .myp-months { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; justify-content: center; }
.myp-years .myp-year, .myp-months .myp-month { padding: 8px 10px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; transition: all .2s; }
.myp-years .myp-year.active, .myp-months .myp-month.active { background: #98041A; color: #fff; border-color: #98041A; }
.myp-actions { display: flex; gap: 8px; justify-content: flex-end; }
.myp-actions button { padding: 8px 12px; border: none; border-radius: 6px; cursor: pointer; }
.myp-actions .myp-today { background: #e9ecef; }
.myp-actions .myp-apply { background: #98041A; color: #fff; }
.myp-actions .myp-close { background: #6c757d; color: #fff; }

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #98041A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .events-calendar-widget { padding: 10px; }
    
    .calendar-header {
        padding: 10px 15px;
    }
    
    .calendar-title {
        font-size: 20px;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .day-cell {
        min-height: 60px;
        padding: 4px;
    }
    
    .day-header {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .day-number {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .event-item {
        font-size: 10px;
    }
    
    .event-item a {
        padding: 1px 2px;
    }
}

@media (max-width: 480px) {
    .calendar-title {
        font-size: 18px;
    }
    
    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .day-cell {
        min-height: 45px;
        padding: 2px;
    }
    
    .day-header {
        padding: 6px 2px;
        font-size: 10px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-item {
        font-size: 9px;
    }
    
    .events-list {
        gap: 1px;
    }
}

/* Print Styles */
@media print {
    .year-month-controls,
    .nav-btn,
    .loading-spinner {
        display: none;
    }
    
    .calendar-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .day-cell {
        border: 1px solid #ccc;
    }
    
    .event-item a {
        color: #000 !important;
        text-decoration: underline;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .day-cell {
        border: 2px solid #000;
    }
    
    .event-item a {
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }
    
    .day-cell.today {
        background: #000;
        color: #fff;
        border-color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .day-cell,
    .nav-btn,
    .event-item a,
    .year-selector,
    .month-selector,
    .calendar-container {
        transition: none;
    }
    
    .day-cell:hover {
        transform: none;
    }
    
    .spinner {
        animation: none;
    }
}