/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #fe2c55;
    --primary-dark: #e91e4d;
    --bg-dark: #000000;
    --bg-card: #121212;
    --bg-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #2a2a2a;
    --success: #00c853;
    --warning: #ffc107;
    --danger: #ff5252;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

button {
    cursor: pointer;
    font-family: inherit;
}

input, textarea {
    font-family: inherit;
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(0,0,0,0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

.header-logo {
    height: 64px;
    max-width: 80%;
    width: auto;
    object-fit: contain;
    
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.title-link {
    text-decoration: none;
}

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

.user-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================== EVENTS CONTAINER ==================== */
.events-container {
    flex: 1;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ==================== EVENTS GRID ==================== */
.events-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-card {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 160px;
}

.event-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.event-card:active {
    transform: scale(0.98);
}

.event-thumbnail {
    width: 120px;
    min-width: 120px;
    height: 160px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.event-thumbnail .play-icon {
    font-size: 2rem;
    color: white;
    opacity: 0.9;
}

.event-info {
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-date {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.event-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.modal-content p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

/* ==================== CLASSICS THEME: LOGIN GATE ==================== */
.classics-gate {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 500;
}

.classics-gate-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
}

.classics-gate-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.classics-gate-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.classics-gate-form .form-group {
    margin-bottom: 12px;
    text-align: left;
}

.classics-gate-btn {
    width: 100%;
    margin-top: 8px;
    background: var(--primary);
    color: var(--text-primary);
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.15s ease;
}

.classics-gate-btn:hover {
    opacity: 0.9;
}

/* ==================== CLASSICS THEME: TABBED LANDING ==================== */
body.themed-landing,
body.themed-landing html {
    height: 100dvh;
    overflow: hidden;
}

body.themed-landing .app-container {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.classics-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    --bottom-tabs-h: 48px;
}

.tab-panel {
    display: none;
    width: 100%;
}

.tab-panel.active {
    display: block;
    animation: tab-fade 180ms ease;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: calc(var(--bottom-tabs-h, 48px) + env(safe-area-inset-bottom, 0px));
}

.tab-panel[data-panel="clips"].active {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    overflow: hidden;
}

.clips-frame-wrap {
    flex: 1;
    min-height: 0;
    padding-bottom: calc(var(--bottom-tabs-h, 48px) + env(safe-area-inset-bottom, 0px));
    background: #000;
}

.clips-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.team-container,
.info-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.team-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.team-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 12px;
}

.team-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.team-tagline {
    font-size: 0.9rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.team-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.team-section-title,
.info-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 12px;
}

.team-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.team-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-list li {
    color: var(--text-primary);
    padding: 10px 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.info-hero {
    text-align: center;
    padding: 24px 16px;
    margin-bottom: 20px;
}

.info-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.info-subtitle {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 500;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.info-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--bottom-tabs-h, 48px) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 200;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bottom-tab {
    background: transparent;
    border: none;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.15s ease;
}

.bottom-tab.active {
    color: var(--primary);
}

.bottom-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 2px 2px;
}

.bottom-tab:hover {
    color: var(--text-primary);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

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

/* ==================== BUTTONS ==================== */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

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

/* ==================== ERROR PAGES ==================== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-content {
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.error-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 32px;
}

.error-content .btn-primary {
    width: auto;
    display: inline-block;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .header-content {
        padding: 24px 16px;
    }
    
    .title {
        font-size: 1.3rem;
    }
    
    .events-container {
        padding: 16px;
    }
    
    .event-card {
        gap: 12px;
        height: 128px;
    }
    
    .event-thumbnail {
        width: 96px;
        min-width: 96px;
        height: 128px;
    }
    
    .event-info {
        padding: 12px 12px 12px 0;
    }
    
    .event-title {
        font-size: 1rem;
    }
}

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

.event-card {
    animation: fadeIn 0.3s ease forwards;
}

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