:root {
    /* Modern Dark Theme Palette */
    --bg-color: #000000;
    --surface-color: #121212;
    --surface-light: #1c1c1e;

    --primary-color: #007aff;
    --primary-gradient: linear-gradient(135deg, #007aff 0%, #00c6ff 100%);
    --primary-glow: rgba(0, 122, 255, 0.4);

    --text-main: #ffffff;
    --text-muted: #86868b;

    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.08);

    --card-radius: 20px;
    --btn-radius: 14px;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    --safe-area-bottom: env(safe-area-inset-bottom);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: calc(80px + var(--safe-area-bottom));
}

/* --- Header --- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 24px 10px 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.menu-btn {
    font-size: 22px;
    color: var(--text-main);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.menu-btn:hover {
    opacity: 1;
}

/* --- Hero Section --- */
.hero-swiper {
    width: 100%;
    height: 60vh;
    /* More immersive */
    max-height: 600px;
    min-height: 400px;
    position: relative;
}

.hero-swiper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--bg-color), transparent);
    z-index: 2;
    pointer-events: none;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: flex-end;
}

.slide-content {
    position: relative;
    z-index: 3;
    padding: 30px 24px 80px 24px;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.slide-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 8px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.slide-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    line-height: 1.4;
    max-width: 90%;
    /* Clamp text to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* --- Concert List --- */
.concert-list-container {
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.concert-item {
    background: var(--surface-light);
    border-radius: var(--card-radius);
    padding: 16px;
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.concert-item:active {
    transform: scale(0.98);
}

.concert-img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.concert-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.concert-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.concert-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.concert-meta i {
    color: var(--primary-color);
}

.concert-description {
    display: none;
    /* Hide in list view for cleaner look */
}

/* Primary Button Style */
.btn-join,
.btn-submit,
.btn-verify {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.3s ease;
}

.btn-join:hover,
.btn-submit:hover,
.btn-verify:hover {
    box-shadow: 0 8px 25px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-join:active,
.btn-submit:active,
.btn-verify:active {
    transform: translateY(0);
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    /* Center on Desktop */
    padding: 20px;
}

/* Mobile Bottom Sheet Animation */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
        /* Bottom on Mobile */
        padding: 0;
    }

    .modal-content {
        border-radius: 24px 24px 0 0 !important;
        max-height: 90vh;
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.modal-content {
    background: #1c1c1e;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.close-modal,
.close-kvkk {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-modal:hover,
.close-kvkk:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

#modal-concert-title {
    font-size: 20px;
    margin-bottom: 25px;
    padding-right: 40px;
    line-height: 1.4;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    /* Prevent ios zoom */
    font-family: var(--font-family);
    transition: 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    padding-left: 44px;
    font-family: 'Courier New', monospace;
    /* Monospace for time input */
    letter-spacing: 2px;
    font-weight: 700;
}

.form-instruction {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.verification-note {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 12px;
    text-align: center;
    opacity: 0.8;
}

/* Steps */
#step-1-verification,
#step-1-5-product,
#step-2-details,
#sms-verification-form {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Skeletons --- */
.skeleton-slide,
.skeleton-item {
    background: linear-gradient(90deg, #1c1c1e 25%, #2c2c2e 50%, #1c1c1e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* --- Product Buttons from JS --- */
.btn-product-option {
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface-light) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-product-option:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-product-option:active {
    transform: scale(0.98);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Mobile Bottom Sheet Animation */
@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
        /* Bottom on Mobile */
        padding: 0;
    }

    .modal-content {
        border-radius: 24px 24px 0 0 !important;
        max-height: 90vh;
        min-height: 45vh;
        /* Increase height for better visibility */
        /* Add padding for safety */
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* --- Success Step Styling --- */
#step-3-success {
    animation: fadeIn 0.4s ease;
}

#step-3-success .success-icon {
    font-size: 80px;
    color: #4cd964;
    margin-bottom: 24px;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

#step-3-success h3 {
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 800;
}

#step-3-success p {
    font-size: 15px;
    line-height: 1.5;
}

.code-display {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.code-display .code-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

#success-unique-code {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes scaleUp {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Message Modal Overrides --- */
/* Ensure message modal is always centered, even on mobile, to act like an alert */
@media (max-width: 768px) {
    #message-modal {
        align-items: center !important;
        /* Override bottom alignment */
        padding: 20px !important;
    }

    #message-modal .modal-content {
        border-radius: 24px !important;
        /* Full radius */
        max-height: auto !important;
        min-height: auto !important;
        padding-bottom: 30px !important;
        animation: fadeIn 0.3s ease !important;
        /* Standard fade instead of slideUp */
        margin: 0 20px;
    }
}

#msg-icon.error {
    color: #ff3b30;
}

#msg-icon.success {
    color: #4cd964;
}

#msg-icon.warning {
    color: #ffcc00;
}

#msg-icon.info {
    color: var(--primary-color);
}