/* ==========================================================================
   Zenith Events Public Styles
   ========================================================================== */

/* --------------------------------------------------
   0. Global Font Settings
   -------------------------------------------------- */

/* Base font for all calendar elements */
#ze-calendar-wrapper {
    max-width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 1px solid #ccc;
    background-color: #f7f7f7;
    position: relative; 
    font-size: 16px;
    line-height: 1.5;
}

/* --------------------------------------------------
   1. Calendar Wrapper and Header
   -------------------------------------------------- */

/* Loading state for AJAX transitions */
#ze-calendar-wrapper.loading-calendar {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.ze-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #eee;
    border-bottom: 1px solid #ccc;
}

.ze-calendar-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.ze-prev-nav, .ze-next-nav {
    background: #fff;
    border: 1px solid #ddd;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.ze-prev-nav:hover, .ze-next-nav:hover {
    background-color: #e0e0e0;
}

/* --------------------------------------------------
   2. Quarter/Year Grid Layout (Main Calendar Content)
   -------------------------------------------------- */

.ze-quarter-grid, .ze-year-grid {
    display: grid;
    /* PHP templates apply: grid-template-columns: repeat(3, 1fr); gap: 20px; */
    padding: 10px;
}

.ze-month-panel {
    border: 1px solid #ddd;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ze-month-panel h3 {
    text-align: center;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.ze-month-grid-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.8em;
    text-align: center;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.ze-mini-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    border: 1px solid #eee;
    background-color: #eee; 
}

/* --------------------------------------------------
   3. Day Cell Styles (The Mini Calendar)
   -------------------------------------------------- */

.ze-mini-day-cell {
    text-align: center;
    font-size: 0.8em;
    line-height: 1.5;
    min-height: 20px;
    background-color: #fff;
    position: relative; /* Must be relative to contain any absolute elements */
    padding: 5px 0;
}

.ze-other-month {
    background-color: #f5f5f5 !important;
    color: #ccc !important;
}

.ze-today {
    border: 2px solid red !important;
}

.ze-has-event {
    background-color: #e6f7ff;
    font-weight: bold;
    border: 1px solid #0073aa;
}

/* *** CRITICAL FIX ***
   Removing position: absolute; from .ze-event-item-link globally.
   The links in Month/Week/Tile views should behave as normal inline or block links.
*/
.ze-event-item-link {
    /* No absolute positioning here */
    display: block; /* Typically set to block or inline-block in templates for sizing */
    z-index: 1; 
    text-decoration: none;
    cursor: pointer;
}

/* --------------------------------------------------
   4. Detailed Event List (Below Month Grid/Tile View)
   -------------------------------------------------- */

.ze-detailed-events-list {
    margin-top: 15px;
}

.ze-detailed-events-list a {
    display: block; 
    font-size: 0.8em; 
    margin: 4px 0; 
    padding: 2px 5px; 
    border-left: 3px solid #0073aa; 
    text-decoration: none; 
    color: #333; 
    overflow: hidden; 
    white-space: nowrap; 
    text-overflow: ellipsis;
    transition: background-color 0.1s;
}

.ze-detailed-events-list a:hover {
    background-color: #f0f8ff;
    color: #0073aa;
}

/* --------------------------------------------------
   5. Event Modal Styles 
   -------------------------------------------------- */

#ze-modal-container {
    display: none; 
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); 
}

#ze-modal-content-area {
    background-color: #fefefe;
    margin: 10% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}

#ze-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1;
}

#ze-modal-close:hover,
#ze-modal-close:focus {
    color: #333;
}

#ze-modal-title {
    margin-top: 0;
    padding-right: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #0073aa;
}

#ze-modal-content p {
    margin: 8px 0;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* --------------------------------------------------
   6. Submission Form Styles 
   -------------------------------------------------- */

.ze-submission-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #eee;
    background-color: #fff;
    border-radius: 5px;
}

.ze-submission-form-wrapper label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

.ze-submission-form-wrapper input[type="text"],
.ze-submission-form-wrapper input[type="time"],
.ze-submission-form-wrapper textarea,
.ze-submission-form-wrapper select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    border-radius: 3px;
}

.ze-submission-form-wrapper input[type="submit"] {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 1em;
    transition: background-color 0.2s;
}

.ze-submission-form-wrapper input[type="submit"]:hover {
    background-color: #005177;
}

.required {
    color: red;
}

/* --------------------------------------------------
   7. jQuery UI Datepicker Overrides 
   -------------------------------------------------- */

.ui-datepicker {
    width: 17em;
    padding: .2em .2em 0;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.ui-datepicker .ui-datepicker-header {
    position: relative;
    padding: .2em 0;
    background: #0073aa;
    color: #fff;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    border: none;
}

.ui-datepicker .ui-state-hover {
    background: #005177 !important;
    color: #fff !important;
    border: none !important;
}