/* ============================================
   Eventickat Integration Demo — Organizer Website
   ============================================ */

:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.15);
    --bg: #0a0a12;
    --bg-card: #13131f;
    --bg-elevated: #1a1a2e;
    --bg-panel: #16162a;
    --border: #252540;
    --text: #e4e4eb;
    --text-muted: #8888a0;
    --text-dim: #55556a;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}
.logo-icon { font-size: 1.4rem; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-badge {
    background: var(--primary-glow);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, #1a0a2e 0%, #0d1117 50%, #0a1628 100%);
    border-bottom: 1px solid var(--border);
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ---- Container ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}
.section { padding: 2.5rem 1.5rem; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.event-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- Events Grid ---- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.event-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}
.card-image {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #1e1040 0%, #0d1a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-image-placeholder { font-size: 4rem; opacity: 0.4; }
.card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 10, 18, 0.8);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-badge.free {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}
.card-body { padding: 1.25rem; }
.card-date { margin-bottom: 0.5rem; }
.date-badge {
    background: var(--primary-glow);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.card-body h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.card-cta {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: gap 0.2s;
}
.event-card:hover .card-cta { letter-spacing: 0.02em; }

/* ---- Event Detail ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.8; }

.event-detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 768px) {
    .event-detail-grid { grid-template-columns: 1fr; }
}

.event-info h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.event-hero-image {
    height: 320px;
    background: linear-gradient(135deg, #1e1040 0%, #0d1a2a 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    opacity: 0.4;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.event-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}
.event-meta-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.meta-icon { font-size: 1.2rem; }
.meta-item small { color: var(--text-dim); font-size: 0.75rem; display: block; }
.meta-item strong { color: #fff; font-size: 0.9rem; }
.event-description h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}
.event-description p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ---- Ticket Panel ---- */
.ticket-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: sticky;
    top: 80px;
    overflow: hidden;
}
.ticket-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.ticket-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.ticket-list { padding: 0.5rem 0; }
.ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(37, 37, 64, 0.5);
    transition: background 0.2s;
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item:hover { background: rgba(124, 58, 237, 0.03); }
.ticket-info h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.ticket-desc {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}
.ticket-price {
    color: var(--success);
    font-weight: 700;
    font-size: 0.95rem;
}
.ticket-avail {
    color: var(--text-dim);
    font-size: 0.7rem;
}

/* Quantity Controls */
.ticket-qty {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}
.qty-btn:first-child { border-radius: 6px 0 0 6px; }
.qty-btn:last-child { border-radius: 0 6px 6px 0; }
.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}
.qty-input {
    width: 42px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border);
    border-left: none;
    border-right: none;
    background: var(--bg);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Customer Fields */
.customer-fields {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(22, 22, 42, 0.5);
}
.customer-fields h4 {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.optional-tag {
    background: var(--bg-elevated);
    color: var(--text-dim);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-weight: 500;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.field-hint {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.field-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.field-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.field-group input::placeholder { color: var(--text-dim); }

/* Checkout Button */
.checkout-btn {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary) 0%, #5b21b6 100%);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}
.checkout-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.checkout-btn:active { transform: translateY(0); }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ---- Alerts ---- */
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.setup-banner {
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
    text-align: center;
}
.setup-banner code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ---- Footer ---- */
.footer {
    margin-top: auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ---- Debug Panel ---- */
.debug-panel {
    max-width: 1100px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}
.debug-panel summary {
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}
.debug-panel pre {
    background: #0d0d15;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: pre-wrap;
    margin-top: 0.5rem;
}
