/**
 * HVAC Master Events Overview Styles
 * 
 * Follows existing HVAC plugin design patterns with responsive layout,
 * consistent spacing, and professional appearance
 */

/* ===================================================================
   CONTAINER AND LAYOUT
   =================================================================== */

.hvac-master-events-overview {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================================================
   KPI TILES SECTION
   =================================================================== */

.hvac-events-kpi-section {
    margin-bottom: 30px;
}

.hvac-kpi-loading {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hvac-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.hvac-kpi-tile {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.hvac-kpi-tile:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.hvac-kpi-icon {
    margin-bottom: 12px;
}

.hvac-kpi-icon .dashicons {
    font-size: 32px;
    color: #007cba;
    width: 32px;
    height: 32px;
}

.hvac-kpi-number {
    font-size: 2.2em;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    margin-bottom: 5px;
}

.hvac-kpi-label {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-kpi-actions {
    text-align: right;
    margin-top: 10px;
}

/* ===================================================================
   FILTERS SECTION
   =================================================================== */

.hvac-events-filters-section {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hvac-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.hvac-filter-group {
    display: flex;
    flex-direction: column;
}

.hvac-filter-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.hvac-filter-group input,
.hvac-filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.3s ease;
}

.hvac-filter-group input:focus,
.hvac-filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.hvac-filter-search {
    grid-column: span 2;
    min-width: 300px;
}

.hvac-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

/* ===================================================================
   VIEW TOGGLE SECTION
   =================================================================== */

.hvac-events-view-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.hvac-view-controls {
    display: flex;
    gap: 10px;
}

.hvac-view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.hvac-view-btn:hover {
    border-color: #007cba;
    color: #007cba;
    background: #f8f9fa;
}

.hvac-view-btn-active {
    background: #007cba !important;
    color: #ffffff !important;
    border-color: #007cba !important;
}

.hvac-view-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.hvac-view-info {
    color: #666;
    font-size: 14px;
}

/* ===================================================================
   EVENTS CONTENT SECTION
   =================================================================== */

.hvac-events-content {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: 400px;
}

/* Loading States */
.hvac-events-loading,
.hvac-calendar-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.hvac-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: hvac-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes hvac-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================================
   TABLE VIEW
   =================================================================== */

.hvac-events-table-wrapper {
    padding: 0;
}

.hvac-events-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.hvac-events-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.hvac-events-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #e0e0e0;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.hvac-events-table th:last-child {
    border-right: none;
}

.hvac-sortable:hover {
    background: #e9ecef;
}

.hvac-sort-indicator {
    margin-left: 5px;
    opacity: 0.5;
}

.hvac-sortable.hvac-sort-asc .hvac-sort-indicator:after {
    content: "↑";
    opacity: 1;
}

.hvac-sortable.hvac-sort-desc .hvac-sort-indicator:after {
    content: "↓";
    opacity: 1;
}

.hvac-events-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    vertical-align: top;
}

.hvac-events-table td:last-child {
    border-right: none;
}

.hvac-events-table tbody tr:hover {
    background: #f8f9fa;
}

.hvac-events-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.hvac-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-status-publish {
    background: #d4edda;
    color: #155724;
}

.hvac-status-draft {
    background: #fff3cd;
    color: #856404;
}

.hvac-status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.hvac-status-upcoming {
    background: #cce5ff;
    color: #004085;
}

.hvac-status-past {
    background: #e2e3e5;
    color: #383d41;
}

/* No Events State */
.hvac-no-events {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.hvac-no-events p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* ===================================================================
   PAGINATION
   =================================================================== */

.hvac-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.hvac-pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #ffffff;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.hvac-pagination-btn:hover {
    border-color: #007cba;
    color: #007cba;
}

.hvac-pagination-btn.hvac-btn-primary {
    background: #007cba;
    border-color: #007cba;
    color: #ffffff;
}

.hvac-pagination-dots {
    padding: 8px 4px;
    color: #999;
}

/* ===================================================================
   CALENDAR VIEW
   =================================================================== */

.hvac-events-calendar-view {
    padding: 0;
}

.hvac-simple-calendar {
    padding: 20px;
}

.hvac-calendar-date-group {
    margin-bottom: 30px;
}

.hvac-calendar-date-header {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007cba;
}

.hvac-calendar-events {
    display: grid;
    gap: 12px;
}

.hvac-calendar-event-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    padding: 15px;
    transition: all 0.3s ease;
}

.hvac-calendar-event-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.hvac-calendar-event-item.hvac-status-draft {
    border-left-color: #ffc107;
}

.hvac-calendar-event-item.hvac-status-pending {
    border-left-color: #17a2b8;
}

.hvac-event-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.hvac-event-title a {
    color: #333;
    text-decoration: none;
}

.hvac-event-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

.hvac-event-trainer {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.hvac-event-details {
    font-size: 12px;
    color: #888;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.hvac-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.hvac-btn-primary {
    background: #007cba;
    color: #ffffff;
    border-color: #007cba;
}

.hvac-btn-primary:hover {
    background: #005a8b;
    border-color: #005a8b;
    color: #ffffff;
}

.hvac-btn-secondary {
    background: #ffffff;
    color: #666;
    border-color: #ddd;
}

.hvac-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

.hvac-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ===================================================================
   NOTICES
   =================================================================== */

.hvac-notice {
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid;
    border-radius: 4px;
}

.hvac-notice-error {
    background: #ffeaea;
    border-left-color: #dc3545;
    color: #721c24;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 1024px) {
    .hvac-master-events-overview {
        padding: 0 15px;
    }
    
    .hvac-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .hvac-filters-row {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .hvac-filter-search {
        grid-column: span 1;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .hvac-events-view-toggle {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .hvac-view-controls {
        justify-content: center;
    }
    
    .hvac-view-info {
        text-align: center;
    }
    
    .hvac-events-table-wrapper {
        overflow-x: auto;
    }
    
    .hvac-events-table {
        min-width: 800px;
    }
    
    .hvac-filter-actions {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    .hvac-pagination {
        flex-wrap: wrap;
    }
    
    .hvac-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hvac-master-events-overview {
        padding: 0 10px;
    }
    
    .hvac-events-filters-section {
        padding: 15px;
    }
    
    .hvac-filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hvac-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .hvac-kpi-tile {
        padding: 15px;
    }
    
    .hvac-view-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .hvac-events-table {
        font-size: 12px;
    }
    
    .hvac-events-table th,
    .hvac-events-table td {
        padding: 8px;
    }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    .hvac-events-filters-section,
    .hvac-events-view-toggle,
    .hvac-kpi-actions,
    .hvac-pagination,
    .hvac-btn {
        display: none !important;
    }
    
    .hvac-master-events-overview {
        max-width: none;
        padding: 0;
    }
    
    .hvac-events-table {
        border: 1px solid #000;
    }
    
    .hvac-events-table th,
    .hvac-events-table td {
        border: 1px solid #000;
    }
}