/**
 * Zenith Events - Calendar Grid Styles
 * 
 * Replaces inline styles with proper CSS classes
 * for maintainability and WordPress compliance.
 *
 * @package ZenithEvents
 * @since 5.0.0
 */

/* ==========================================================================
   Calendar Grid Layouts
   ========================================================================== */

/* Year View Grid */
.ze-year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 0;
    background: #e8e8e8;
}

/* Quarter View Grid */
.ze-quarter-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 0;
    background: #e8e8e8;
}

/* Month View Headers */
.ze-month-header-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    gap: 2px;
}

.ze-month-header-cell {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.85em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Month View Calendar Grid */
.ze-month-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #e8e8e8;
}

/* Day Cell Base Styles */
.ze-day-cell {
    padding: 12px 8px;
    min-height: 100px;
    background: #fff;
    position: relative;
    box-sizing: border-box;
}

.ze-day-cell.other-month {
    background: #fafafa;
}

.ze-day-cell.ze-today {
    border: 2px solid #0073aa;
    z-index: 10;
}

/* Week View Grid */
.ze-week-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.ze-week-table th {
    padding: 15px 10px;
    text-align: center;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 400;
}

.ze-week-table td {
    border-right: 1px solid #e8e8e8;
    padding: 12px;
    vertical-align: top;
    min-height: 150px;
    background: #fff;
}

.ze-week-table td.ze-today {
    background: #fafafa;
}

/* Year/Quarter Month Container */
.ze-mini-month-container {
    background: #fff;
    padding: 20px;
}

.ze-mini-month-title {
    margin: 0 0 15px 0;
    font-size: 1em;
    font-weight: 400;
    color: #666;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.ze-mini-month-header {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #fafafa;
    font-weight: bold;
    gap: 2px;
}

.ze-mini-day-name {
    padding: 4px 0;
    text-align: center;
    font-size: 0.7em;
    color: #999;
    background: #fafafa;
}

.ze-mini-day-cell {
    padding: 8px 4px;
    min-height: 30px;
    text-align: center;
    font-size: 0.75em;
    background: #fff;
    position: relative;
    transition: all 0.2s;
}

.ze-mini-day-cell.ze-empty {
    background: #fafafa;
}

.ze-mini-day-cell.ze-today {
    background: #fafafa;
}

.ze-mini-day-cell:not(.ze-empty):hover {
    background: #fafafa;
}

/* Day Number Styling */
.ze-day-number {
    font-weight: bold;
    text-align: right;
    margin-bottom: 5px;
    color: #333;
}

.ze-day-cell.other-month .ze-day-number {
    color: #aaa;
}

.ze-mini-day-number {
    font-size: 0.9em;
    color: #666;
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

/* Mobile Portrait: Stack all grids to single column */
@media (max-width: 768px) and (orientation: portrait) {
    .ze-year-grid,
    .ze-quarter-months {
        grid-template-columns: 1fr;
    }
    
    .ze-day-cell {
        min-height: 60px;
    }
}

/* Mobile Landscape: 2-column layout for year/quarter */
@media (max-width: 1024px) and (orientation: landscape) {
    .ze-year-grid,
    .ze-quarter-months {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Center 3rd month in quarter view */
    .ze-quarter-months > div:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
}

/* Week View Mobile Portrait: Vertical Stack */
@media (max-width: 768px) and (orientation: portrait) {
    .ze-week-table {
        display: block;
    }
    
    .ze-week-table thead {
        display: none;
    }
    
    .ze-week-table tbody {
        display: block;
    }
    
    .ze-week-table tr {
        display: block;
    }
    
    .ze-week-table td {
        display: block;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        margin-bottom: 15px;
        padding: 15px;
        min-height: auto;
    }
}
