/* ==========================================================================
   Zenith Events - Shared Template Styles (Minimal Elegant)
   ========================================================================== */

/* Fix for Twenty Twenty-Five theme (and similar) that applies fixed dimensions to body */
body:has(.ze-calendar-wrapper) {
    width: auto !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* --------------------------------------------------
   1. Calendar Wrapper & Universal Styles
   -------------------------------------------------- */

.ze-calendar-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* --------------------------------------------------
   2. Universal Header Style
   -------------------------------------------------- */

.ze-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    min-height: 80px;
}

.ze-calendar-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 300;
    color: #333;
    letter-spacing: -0.5px;
}

/* Navigation Buttons */
.ze-prev-nav,
.ze-next-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #999;
    text-decoration: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.ze-prev-nav:hover,
.ze-next-nav:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f8fbfd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.ze-prev-nav:active,
.ze-next-nav:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --------------------------------------------------
   3. Universal Event Item Styles
   -------------------------------------------------- */

.ze-event-item-link {
    display: block;
    text-decoration: none;
    color: #666;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ze-event-item-link:hover {
    color: #0073aa;
}

/* Event item in list contexts */
.ze-event-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #fafafa;
    border-left: 3px solid transparent;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ze-event-item:hover {
    border-left-color: #0073aa;
    background: #f5f5f5;
    transform: translateX(3px);
}

/* --------------------------------------------------
   4. Universal Footer / iCal Button
   -------------------------------------------------- */

.ze-calendar-footer {
    padding: 30px 40px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
}

.ze-ical-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ze-ical-button:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f8fbfd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.ze-ical-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------
   5. Typography
   -------------------------------------------------- */

.ze-event-title {
    font-size: 1.1em;
    font-weight: 400;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.ze-event-time {
    font-size: 0.85em;
    color: #999;
    font-weight: 400;
}

.ze-event-location {
    font-size: 0.85em;
    color: #999;
}

.ze-day-header {
    font-size: 1em;
    font-weight: 400;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 0;
    margin: 30px 0 15px 0;
    border-bottom: 1px solid #e8e8e8;
}

/* --------------------------------------------------
   6. Utility Classes
   -------------------------------------------------- */

.ze-today {
    position: relative;
}

.ze-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #0073aa;
    pointer-events: none;
    border-radius: 2px;
}

.ze-no-events {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 0.95em;
}

/* --------------------------------------------------
   7. Loading States
   -------------------------------------------------- */

.ze-calendar-wrapper.loading-calendar {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* --------------------------------------------------
   8. Responsive Design
   -------------------------------------------------- */

@media (max-width: 768px) {
    .ze-calendar-wrapper {
        margin: 20px auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .ze-calendar-header {
        padding: 20px 15px;
        min-height: 60px;
    }
    
    .ze-calendar-header h2 {
        font-size: 1.3em;
    }
    
    .ze-prev-nav,
    .ze-next-nav {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
    
    .ze-calendar-footer {
        padding: 20px 15px;
    }
    
    .ze-ical-button {
        padding: 10px 20px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .ze-calendar-header h2 {
        font-size: 1.1em;
    }
    
    .ze-prev-nav,
    .ze-next-nav {
        width: 32px;
        height: 32px;
    }
}
/* ==========================================================================
   Day Events Modal (Year & Quarter Views)
   ========================================================================== */

.ze-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ze-modal[style*="display: block"] {
    display: flex; /* When shown via JavaScript, use flex layout */
}

.ze-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
}

.ze-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 10002;
    overflow: hidden;
}

.ze-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ze-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.ze-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.ze-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.ze-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.ze-modal-event-item {
    padding: 15px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: all 0.2s;
}

.ze-modal-event-item:hover {
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.ze-modal-event-item:last-child {
    margin-bottom: 0;
}

.ze-modal-event-time {
    font-size: 0.85em;
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 5px;
}

.ze-modal-event-title {
    font-size: 1em;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}

.ze-modal-event-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: color 0.2s;
}

.ze-modal-event-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.ze-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    text-align: right;
}

.ze-modal-close-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.2s;
}

.ze-modal-close-btn:hover {
    background: #005a87;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ze-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .ze-modal-header,
    .ze-modal-body,
    .ze-modal-footer {
        padding: 15px;
    }
    
    .ze-modal-event-item {
        padding: 12px;
    }
}

/* ==========================================================================
   Year View Specific Styles
   ========================================================================== */

/* Year view event dots */
.ze-event-dot {
    display: block;
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    margin: 4px auto;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,115,170,0.3);
    position: relative;
    z-index: 1;
}

.ze-event-dot:hover {
    transform: scale(1.3);
    background: #005a87;
    box-shadow: 0 3px 6px rgba(0,115,170,0.5);
}

.ze-event-dot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    transform: scale(1.3);
}

.ze-dot-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.ze-event-count {
    font-size: 0.65em;
    color: #0073aa;
    font-weight: 700;
    margin-top: 2px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    padding: 1px 4px;
    display: inline-block;
}

/* Responsive year view */
@media (min-width: 1025px) {
    .ze-year-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ze-year-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ze-year-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .ze-year-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================

/* ==========================================================================
   Mobile Responsive Event Display (Month View)
   ========================================================================== */

/* Desktop: Show event titles in month view, hide mobile badge */
.ze-desktop-events {
    display: block;
}

.ze-mobile-events {
    display: none;
}

/* Year/Quarter badges - show on ALL screen sizes */
.ze-mobile-only {
    display: inline-block !important;
}

/* Year/Quarter old dots/counters - hide on ALL screen sizes */
.ze-desktop-events .ze-event-dot,
.ze-desktop-events .ze-event-count {
    display: none !important;
}

/* Mobile: Show badge for month view, hide titles */
@media (max-width: 768px) {
    /* Month view mobile behavior */
    .ze-desktop-events {
        display: none;
    }
    
    .ze-mobile-events {
        display: block !important;
    }
    
    /* Reduce cell height on mobile */
    .ze-day-cell {
        min-height: 60px !important;
    }
}

/* ==========================================================================
   Mobile Touch Target Improvements
   ========================================================================== */

/* Enhanced tap targets for mobile */
.ze-mobile-tap-target {
    /* Ensure minimum touch target size */
    -webkit-tap-highlight-color: rgba(0, 115, 170, 0.2);
    touch-action: manipulation; /* Disable double-tap zoom */
}

/* Badge hover/active states (simplified mobile badges) */
.ze-event-count.ze-mobile-tap-target:hover {
    background: #e6f7ff !important;
    border-color: #005a87 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,115,170,0.3) !important;
}

.ze-event-count.ze-mobile-tap-target:active {
    background: #cce7ff !important;
    border-color: #004a70 !important;
    transform: scale(0.98);
}

/* Desktop dot styles (unchanged) */
.ze-event-dot:hover {
    transform: scale(2);
    background: #005a87 !important;
}

.ze-event-dot:active {
    transform: scale(1.8);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* Month view badges - larger */
    .ze-mobile-events .ze-event-count.ze-mobile-tap-target {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Year/Quarter view badges - compact but tappable */
    .ze-mobile-only.ze-event-count {
        /* Already sized appropriately in inline styles */
        /* Ensure visible and tappable */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Accessibility: Focus states */
.ze-mobile-tap-target:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ze-mobile-tap-target:focus:not(:focus-visible) {
    outline: none;
}
