/* ===== VARIABLES ===== */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    
    --accent-cyan: #00f5ff;
    --accent-magenta: #ff00ff;
    --accent-lime: #39ff14;
    
    --border-color: #222222;
    --border-light: #333333;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-glow: 0 0 30px rgba(0, 245, 255, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
    
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SPLASH SCREEN ===== */
.splash {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.splash.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-large {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== FORMS ===== */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

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

.input-group input[type="date"] {
    color-scheme: dark;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Image Upload */
.image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg-card);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 150px;
}

.image-upload:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-card-hover);
}

.image-upload.has-image {
    padding: 0;
    border-style: solid;
}

.image-upload svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.image-upload span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.image-upload.has-image svg,
.image-upload.has-image span {
    display: none;
}

#imagePreview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #00d4e0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-card);
    border-color: var(--accent-cyan);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ===== APP LAYOUT ===== */
.app {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.app.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    padding-top: var(--safe-area-top);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.admin-badge {
    background: var(--accent-magenta);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.1em;
}

.admin-password-group {
    margin-top: 8px;
}

.admin-password-group input {
    font-size: 0.9rem;
}

/* Event action buttons (edit/delete) */
.event-actions-top {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.event-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.event-action-btn svg {
    width: 16px;
    height: 16px;
}

.event-action-btn.edit {
    background: rgba(0, 245, 255, 0.9);
    color: black;
}

.event-action-btn.edit:hover {
    background: var(--accent-cyan);
    transform: scale(1.1);
}

.event-action-btn.delete {
    background: rgba(255, 0, 100, 0.9);
    color: white;
}

.event-action-btn.delete:hover {
    background: #ff0064;
    transform: scale(1.1);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 280px;
    background-size: cover;
    background-position: center;
    margin-top: calc(60px + var(--safe-area-top));
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-primary) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 24px 20px;
    width: 100%;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.neon-text {
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 16px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
}

/* ===== MONTH NAVIGATION ===== */
.month-nav {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.month-nav::-webkit-scrollbar {
    display: none;
}

.month-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.month-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.month-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

/* ===== EVENTS ===== */
.events-container {
    padding: 0 16px 120px;
}

.events-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Event Card */
.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
}

.event-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-card);
}

/* Past Events */
.event-card.past {
    opacity: 0.5;
    filter: grayscale(70%);
}

.event-card.past:hover {
    opacity: 0.7;
    filter: grayscale(50%);
}

.event-card.past .event-btn:not(.ticket) {
    pointer-events: none;
    opacity: 0.5;
}

.past-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    border: 1px solid var(--border-color);
}

.event-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.event-date-badge .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    line-height: 1;
}

.event-date-badge .month {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 2px;
}

.event-content {
    padding: 16px;
}

.event-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.event-meta-item svg {
    width: 16px;
    height: 16px;
    color: var(--accent-cyan);
}

.event-actions {
    display: flex;
    gap: 12px;
}

.event-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.event-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.event-btn svg {
    width: 18px;
    height: 18px;
}

.event-btn.attending {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.event-btn.attending:hover {
    background: rgba(0, 245, 255, 0.2);
}

.event-btn.ticket {
    background: var(--accent-magenta);
    border-color: var(--accent-magenta);
    color: var(--text-primary);
}

.event-btn.ticket:hover {
    opacity: 0.9;
}

/* Attendees */
.event-attendees {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.attendees-avatars {
    display: flex;
}

.attendee-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bg-primary);
    margin-left: -8px;
}

.attendee-avatar:first-child {
    margin-left: 0;
}

.attendees-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.attendees-count strong {
    color: var(--accent-cyan);
}

/* No Events */
.no-events {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-events svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.no-events p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: calc(80px + var(--safe-area-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--accent-cyan);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 245, 255, 0.4);
    transition: all 0.3s;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 245, 255, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 24px;
    height: 24px;
    color: var(--bg-primary);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--accent-cyan);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--accent-lime);
    color: var(--accent-lime);
}

.toast.error {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .events-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        height: 350px;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .modal-content {
        padding: 40px 32px;
    }
}

@media (min-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .events-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: fadeInUp 0.4s ease backwards;
}

.event-card:nth-child(1) { animation-delay: 0.05s; }
.event-card:nth-child(2) { animation-delay: 0.1s; }
.event-card:nth-child(3) { animation-delay: 0.15s; }
.event-card:nth-child(4) { animation-delay: 0.2s; }
.event-card:nth-child(5) { animation-delay: 0.25s; }
