/**
 * What's On - Local Events
 * Responsive styles
 */

/* ==========================================================================
   Listing Page
   ========================================================================== */

.whats-on-listing {
    margin: 1.5rem 0;
}

.whats-on-no-events {
    padding: 2rem;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Filters */
.whats-on-filters {
    margin-bottom: 1.5rem;
}

.whats-on-filter-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.whats-on-filter-form label {
    font-weight: 500;
}

.whats-on-filter-form select {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
}

/* ==========================================================================
   Table View
   ========================================================================== */

.whats-on-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.whats-on-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.whats-on-table th,
.whats-on-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.whats-on-table th {
    background: #f5f5f5;
    font-weight: 600;
    white-space: nowrap;
}

.whats-on-table tbody tr:hover {
    background: #fafafa;
}

.whats-on-table a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.whats-on-table a:hover {
    text-decoration: underline;
}

/* Status rows */
.whats-on-row.whats-on-status-cancelled {
    opacity: 0.6;
}

.whats-on-row.whats-on-status-postponed {
    opacity: 0.8;
}

/* Badges */
.whats-on-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.whats-on-badge-cancelled {
    background: #d32f2f;
    color: #fff;
}

.whats-on-badge-postponed {
    background: #f57c00;
    color: #fff;
}

.whats-on-badge-soldout {
    background: #616161;
    color: #fff;
}

/* ==========================================================================
   Card View
   ========================================================================== */

.whats-on-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.whats-on-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.whats-on-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.whats-on-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.whats-on-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.whats-on-card:hover .whats-on-card-image img {
    transform: scale(1.05);
}

.whats-on-card-content {
    padding: 1rem;
}

.whats-on-card-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.whats-on-card-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.whats-on-card-title a {
    color: inherit;
    text-decoration: none;
}

.whats-on-card-title a:hover {
    text-decoration: underline;
}

.whats-on-card-venue {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.25rem;
}

.whats-on-card-category {
    font-size: 0.8rem;
    color: #888;
}

/* Card status styling */
.whats-on-card.whats-on-status-cancelled {
    opacity: 0.7;
}

.whats-on-card.whats-on-status-postponed {
    opacity: 0.85;
}

/* ==========================================================================
   Single Event Page
   ========================================================================== */

.whats-on-event {
    max-width: 800px;
    margin: 0 auto;
}

.whats-on-not-found {
    padding: 3rem;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Status banner */
.whats-on-status-banner {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.whats-on-status-banner.whats-on-status-cancelled {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.whats-on-status-banner.whats-on-status-postponed {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

/* Event image */
.whats-on-event-image {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.whats-on-event-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Event header */
.whats-on-event-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.whats-on-event-title {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.whats-on-event-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
}

/* Event details */
.whats-on-event-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.whats-on-detail {
    font-size: 0.95rem;
    line-height: 1.5;
}

.whats-on-detail strong {
    display: block;
    color: #333;
    margin-bottom: 0.25rem;
}

.whats-on-address {
    color: #666;
    font-size: 0.9rem;
}

/* Ticket button */
.whats-on-ticket-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #1976d2;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.whats-on-ticket-button:hover {
    background: #1565c0;
}

/* Event description */
.whats-on-event-description {
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.7;
}

.whats-on-event-description p {
    margin-bottom: 1rem;
}

.whats-on-event-description p:last-child {
    margin-bottom: 0;
}

/* Back link */
.whats-on-back {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.whats-on-back a {
    color: #666;
    text-decoration: none;
}

.whats-on-back a:hover {
    color: #333;
    text-decoration: underline;
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Stack table on mobile */
    .whats-on-table,
    .whats-on-table thead,
    .whats-on-table tbody,
    .whats-on-table th,
    .whats-on-table td,
    .whats-on-table tr {
        display: block;
    }
    
    .whats-on-table thead {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .whats-on-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        background: #fff;
    }
    
    .whats-on-table td {
        position: relative;
        padding: 0.75rem 1rem 0.75rem 40%;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .whats-on-table td:last-child {
        border-bottom: none;
    }
    
    .whats-on-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 35%;
        font-weight: 600;
        color: #666;
    }
    
    /* Single event adjustments */
    .whats-on-event-title {
        font-size: 1.4rem;
    }
    
    .whats-on-event-details {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    /* Cards on mobile */
    .whats-on-cards {
        grid-template-columns: 1fr;
    }
    
    /* Filter on mobile */
    .whats-on-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .whats-on-filter-form select {
        width: 100%;
        min-width: auto;
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
    .whats-on-filters,
    .whats-on-back,
    .whats-on-ticket-button {
        display: none;
    }
    
    .whats-on-table {
        font-size: 0.85rem;
    }
    
    .whats-on-card {
        break-inside: avoid;
    }
}
