/* EventBiljett - Mobile-First Event Ticketing App
   Design: Modern Nordic aesthetic with bold accents */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
    /* Colors - Nordic Night Theme */
    --bg-primary: #0a0e17;
    --bg-secondary: #141b2d;
    --bg-card: #1a2238;
    --bg-elevated: #243055;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --seat-available: #22c55e;
    --seat-selected: #6366f1;
    --seat-taken: #374151;
    --seat-vip: #f59e0b;
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Borders */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-md) 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-mobile {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.nav-btn:hover, .nav-btn:active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: var(--space-2xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

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

.hero-title {
    margin-bottom: var(--space-md);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

/* Search Box */
.search-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    display: flex;
    gap: var(--space-sm);
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-lg);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.search-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

/* Event Cards */
.events-section {
    padding: var(--space-xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.view-all {
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 640px) {
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.event-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-base);
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.event-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.event-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-badge.sold-out {
    background: var(--error);
}

.event-badge.few-left {
    background: var(--warning);
}

.event-content {
    padding: var(--space-md);
}

.event-date {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.event-title {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-location {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.event-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.event-price span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Event Detail Page */
.event-detail {
    padding: var(--space-lg) 0;
}

.event-hero {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.event-hero-image {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
}

.event-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.95) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-xl);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.meta-item svg {
    color: var(--accent-primary);
}

/* Venue Seating Map */
.venue-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.venue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.seat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm);
}

.legend-dot.available { background: var(--seat-available); }
.legend-dot.selected { background: var(--seat-selected); }
.legend-dot.taken { background: var(--seat-taken); }
.legend-dot.vip { background: var(--seat-vip); }

/* Stage */
.stage {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 50% 50%;
    padding: var(--space-md);
    text-align: center;
    margin-bottom: var(--space-xl);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Seating Grid */
.seating-container {
    overflow-x: auto;
    padding: var(--space-md) 0;
    -webkit-overflow-scrolling: touch;
}

.seating-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: max-content;
    margin: 0 auto;
}

.seat-row {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    justify-content: center;
}

.row-label {
    width: 24px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.seats {
    display: flex;
    gap: var(--space-xs);
}

.seat {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
}

@media (min-width: 640px) {
    .seat {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

.seat.available {
    background: var(--seat-available);
    color: white;
}

.seat.available:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--seat-available);
}

.seat.selected {
    background: var(--seat-selected);
    color: white;
    border-color: white;
    transform: scale(1.05);
}

.seat.taken {
    background: var(--seat-taken);
    cursor: not-allowed;
    color: var(--text-muted);
}

.seat.vip {
    background: var(--seat-vip);
    color: var(--bg-primary);
}

.seat.vip:hover {
    box-shadow: 0 0 10px var(--seat-vip);
}

/* Aisle */
.aisle {
    width: 20px;
}

/* Booking Summary */
.booking-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-md);
    transform: translateY(100%);
    transition: var(--transition-base);
    z-index: 90;
}

.booking-summary.active {
    transform: translateY(0);
}

.summary-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.summary-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.selected-seats {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.summary-total {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

/* Checkout */
.checkout-section {
    padding: var(--space-xl) 0;
}

.checkout-grid {
    display: grid;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr 380px;
    }
}

.checkout-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Order Summary Card */
.order-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    position: sticky;
    top: 100px;
}

.order-event {
    display: flex;
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-lg);
}

.order-event-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.order-event-info h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.order-event-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.order-items {
    margin-bottom: var(--space-lg);
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
}

.order-item.total {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-md);
}

/* Stripe Element */
.stripe-element {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

/* Loading States */
.htmx-request .btn-text {
    display: none;
}

.htmx-request .btn-loading {
    display: inline-flex;
}

.btn-loading {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border-left: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Confirmation Page */
.confirmation {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.confirmation-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.ticket-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 400px;
    margin: var(--space-xl) auto;
    text-align: left;
}

.ticket-qr {
    background: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.ticket-details {
    display: grid;
    gap: var(--space-md);
}

.ticket-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.ticket-detail-label {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: var(--space-xl) 0;
    margin-top: var(--space-2xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
}

@media (min-width: 640px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }

/* Safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .booking-summary {
        padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
    }
}
