/* Base & Reset */
:root {
    --bg-dark: #0f0c29;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
    --text-muted: #rgba(255, 255, 255, 0.7);
    --accent: #ff0080;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    background: linear-gradient(to right, #0f0c29, #302b63, #24243e);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    padding-bottom: 50px;
    overflow-x: hidden;
}

/* Background Shapes for Glassmorphism depth */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite alternate;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #ff0080;
    top: -50px;
    left: -50px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #764ba2;
    bottom: 10%;
    right: -100px;
    animation-delay: 2s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #00d2ff;
    top: 40%;
    left: 40%;
    animation-delay: 4s;
    opacity: 0.6;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.events-container h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
    border-left: 5px solid var(--accent);
    padding-left: 15px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

/* Event Card - Glassmorphism */
.event-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
    /* Changed from fixed height to accommodate image */
    min-height: 250px;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 45%, transparent 50%);
    transform: translateX(-150%);
    transition: 0.6s;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.event-card:hover::before {
    transform: translateX(150%);
}

.card-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.event-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.event-date {
    font-size: 0.9rem;
    color: #ff0080;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.event-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.event-location {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

.event-price {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00d2ff;
    align-self: flex-end;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(30, 30, 40, 0.85);
    /* Darker specifically for contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    color: white;
}

.modal.visible .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.modal-meta {
    font-size: 0.95rem;
    color: #bbb;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ddd;
}

.glass-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.glass-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.glass-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.price-summary {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: right;
}

.price-summary p {
    font-size: 0.9rem;
    color: #bbb;
    margin-bottom: 5px;
}

.price-summary h3 {
    font-size: 1.5rem;
    color: #00d2ff;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #0cebeb 0%, #20e3b2 100%);
    color: #0f0c29;
    margin-top: 15px;
}

.success-msg {
    text-align: center;
    color: #20e3b2;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 20px 0;
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 50px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Ticket Template (Off-screen) */
.off-screen {
    position: absolute;
    top: -9999px;
    left: -9999px;
    /* We want this rendered to DOM for html2canvas but not visible to user */
}

.ticket-card {
    width: 650px;
    height: 320px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f2f5 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #333;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ticket-header {
    background: #0f0c29;
    color: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ticket-logo {
    width: 35px;
    height: 35px;
    filter: invert(1);
    /* Ensure it looks good if it was designed for dark mode */
}

.brand-name {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.ticket-body {
    padding: 25px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ticket-main-content {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.ticket-artist-img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background-color: #eee;
}

.ticket-show-name {
    font-size: 2.2rem;
    color: #764ba2;
    text-transform: uppercase;
    line-height: 1.1;
}

.ticket-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

.value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.value.price {
    color: #ff0080;
}

.ticket-footer {
    background: #e0e0e0;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    letter-spacing: 2px;
}

/* --- Mobile Optimization --- */

/* Tablet & Mobile (up to 768px) */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .events-container h2 {
        font-size: 1.5rem;
    }

    /* Event Card adjustments */
    .event-card {
        min-height: auto;
    }

    .event-image {
        width: 70px;
        height: 70px;
    }

    .event-title {
        font-size: 1.2rem;
    }

    /* Modal adjustments */
    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .close-btn {
        top: 10px;
        right: 15px;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    h1 {
        font-size: 1.6rem;
    }

    /* Stack event card header elements if they get too cramped, 
       or just keep them side-by-side but smaller */
    .card-header {
        gap: 10px;
    }

    .event-image {
        width: 60px;
        height: 60px;
    }

    .event-title {
        font-size: 1.1rem;
    }

    .event-date {
        font-size: 0.8rem;
    }

    /* Modal Form inputs */
    .glass-input,
    .btn-primary,
    .btn-secondary {
        padding: 10px;
        font-size: 1rem;
    }

    .price-summary h3 {
        font-size: 1.3rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}