/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Better text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent font size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    /* Safe area insets for notched devices */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: url('/static/blucifer.jpg');
    background-size: 85%;
    background-position: center 18%;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(30, 58, 138, 0.85) 0%, rgba(30, 58, 138, 0.6) 40%, rgba(30, 58, 138, 0.3) 70%, transparent 100%);
    pointer-events: none;
}

header .header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    font-weight: 900;
    font-family: Impact, 'Arial Black', 'Helvetica Inserat', 'Franklin Gothic Bold', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ff6b35;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.8), 
                 -1px -1px 0px rgba(0,0,0,0.3);
    transform: skewY(-2deg);
}

header h1 a,
header h1 a:link,
header h1 a:visited,
header h1 a:hover,
header h1 a:active {
    color: #ff6b35 !important;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

header h1 a:hover {
    opacity: 0.9;
}

header .tagline {
    font-size: 1.4rem;
    opacity: 1;
    font-weight: 700;
    font-family: Impact, 'Arial Black', sans-serif;
    color: #ff8c42;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.7);
    letter-spacing: 0.03em;
}

header .subtagline {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-section h2 {
    margin-bottom: 0;
    color: #667eea;
}

.toggle-filters {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #667eea;
    transition: transform 0.3s;
}

.toggle-filters.collapsed .filter-icon {
    transform: rotate(-90deg);
    display: inline-block;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 150px;
}

.filter-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-secondary:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Better focus states for accessibility */
select:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 1px;
}

/* Site Description */
.site-description {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.site-description p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Events Section */
.events-section {
    margin-bottom: 3rem;
}

.events-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.event-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-content {
    padding: 1.25rem;
}

.event-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.event-date,
.event-venue,
.event-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-dates-multiple {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.event-date-extra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

.event-date-more {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.3rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.event-date-more:hover {
    background: #c7d2fe;
    transform: translateY(-1px);
}

.event-date-more:active {
    transform: translateY(0);
}

.all-dates-list {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.additional-date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    gap: 1rem;
}

.additional-date-time {
    flex: 1;
    font-size: 0.85rem;
    color: #666;
}

.btn-date-tickets {
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-date-tickets:hover {
    background: #5568d3;
}

.event-category {
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #e0e7ff;
    color: #667eea;
}

.badge-free {
    background: #d1fae5;
    color: #059669;
}

.event-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #666;
}

.event-description {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.no-events {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #667eea;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0 0 0.5rem 0;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

footer .footer-links a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: #fff;
}

footer .footer-links span {
    color: #6b7280;
}

footer .social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

footer .social-links a {
    color: #9ca3af;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

footer .social-links a:hover {
    color: #fff;
}

footer .social-links svg {
    width: 18px;
    height: 18px;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    footer .footer-links {
        flex-wrap: wrap;
    }
    
    footer .footer-links a {
        color: #e5e7eb;
        font-size: 0.9rem;
    }
    
    footer .footer-links span {
        color: #9ca3af;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    /* Header - More compact on mobile */
    header {
        padding: 2.5rem 0;
        margin-bottom: 1.5rem;
        min-height: 260px;
    }

    header {
        background-size: cover;
        background-position: center 23%;
    }

    header h1 {
        font-size: 3rem !important;
        line-height: 1.2;
        margin-bottom: 1rem !important;
    }

    header .tagline {
        font-size: 1.5rem !important;
        margin-top: 1rem !important;
    }

    header .subtagline {
        font-size: 0.85rem;
    }

    /* Filters - Mobile optimized */
    .filters-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .filters-header {
        margin-bottom: 0.75rem;
    }

    .filters-section h2 {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    /* Show collapse button on mobile */
    .toggle-filters {
        display: block;
    }

    /* Collapsible filters on mobile */
    .filters.collapsed {
        display: none;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-group {
        gap: 0.4rem;
    }

    .filter-group label {
        font-size: 0.875rem;
    }

    .filter-group select,
    .filter-group input[type="text"] {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        min-width: auto;
        -webkit-appearance: none;
        appearance: none;
    }

    /* Checkbox filter - Larger touch target */
    .filter-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem;
    }

    /* Buttons - Minimum 48px touch target */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        touch-action: manipulation;
    }

    /* Events Grid - Single column on mobile */
    .events-section {
        margin-bottom: 2rem;
    }

    .events-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Event Cards - Optimized for mobile */
    .event-card {
        border-radius: 12px;
    }

    .event-image {
        height: 180px;
    }

    .event-content {
        padding: 1rem;
    }

    .event-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .event-meta {
        font-size: 0.85rem;
        gap: 0.4rem;
    }

    .event-description {
        font-size: 0.875rem;
    }

    /* Tags and badges - Smaller on mobile */
    .badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }

    /* Footer */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    footer p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* No events message */
    .no-events {
        padding: 2rem 1rem;
    }

    /* Loading indicator */
    .loading {
        padding: 1.5rem;
        font-size: 1rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    header {
        background-size: cover;
        background-position: center 20%;
        padding: 2rem 0;
        min-height: 180px;
    }
    
    header::after {
        background: linear-gradient(to right, rgba(30, 58, 138, 0.9) 0%, rgba(30, 58, 138, 0.7) 50%, rgba(30, 58, 138, 0.3) 100%);
    }

    header h1 {
        font-size: 1.6rem;
    }

    header .tagline {
        font-size: 0.95rem;
    }

    .filters-section {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        padding: 1rem 12px;
    }

    .event-card {
        border-radius: 8px;
    }

    .event-image {
        height: 160px;
    }

    .event-title {
        font-size: 1rem;
    }

    .events-section h2 {
        font-size: 1.25rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .event-card:hover {
        transform: none;
    }

    /* Active state for better touch feedback */
    .event-card:active {
        opacity: 0.9;
    }

    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }

    /* Larger tap targets */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
    }

    /* Better spacing for touch */
    .filter-group {
        margin-bottom: 0.5rem;
    }

    /* Prevent tap highlight on iOS */
    * {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
}

/* Dark mode support (respects system preference) */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles in future */
    /* For MVP, keeping light mode only */
}

/* View Toggle */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.view-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.view-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* List View */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.event-list-item {
    display: grid;
    grid-template-columns: 120px 1fr 150px;
    gap: 2rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
    min-height: 60px;
}

.event-list-item:last-child {
    border-bottom: none;
}

.event-list-item:hover {
    background: #f9fafb;
}

.event-list-item .event-image,
.event-list-item .event-image-placeholder,
.event-list-item .event-meta,
.event-list-item .event-category,
.event-list-item .event-tags,
.event-list-item .event-description,
.event-list-item .event-price {
    display: none !important;
}

.event-list-item .list-date-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.1rem;
    min-width: 120px;
}

.event-list-item .list-day {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-list-item .list-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.event-list-item .list-time {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.event-list-item .event-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.event-list-item .event-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-list-item .event-venue {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-list-item .event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.event-list-item .btn-secondary {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Mobile adjustments for list view */
@media (max-width: 768px) {
    .event-list-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .event-list-item .list-date-block {
        min-width: 80px;
        grid-row: 1 / 3;
    }
    
    .event-list-item .event-content {
        grid-column: 2;
        grid-row: 1;
    }
    
    .event-list-item .event-title {
        font-size: 0.9rem;
        white-space: normal;
        overflow: visible;
    }
    
    .event-list-item .event-venue {
        white-space: normal;
        overflow: visible;
    }
    
    .event-list-item .event-actions {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    .event-list-item .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

