/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    background: #0a0a0a;
    color: #e0e0e0;
    scroll-behavior: smooth;
}

/* ===== Navbar ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: rgba(15,15,15,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1f1f1f;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f87171;
    text-decoration: none;
    letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a, .nav-links .btn-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-links a:hover, .nav-links .btn-link:hover { color: #fff; }
.nav-links a.active { color: #f87171; }

/* ===== Hero ===== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(135deg, #1a0000 0%, #0d0d0d 50%, #000d1a 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(185,28,28,0.08) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    margin: 0 0 0.5rem;
    letter-spacing: -2px;
}
.hero h1 span { color: #f87171; }
.hero p { color: #888; font-size: 1.1rem; margin: 0; }

/* ===== Layout ===== */
.main-content { padding: 0; }
.content { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== Filter ===== */
.filter-bar {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
}
.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #ccc;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.filter-toggle:hover { background: #161616; }
.filter-active-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #f87171;
    border-radius: 50%;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.filter-chevron { transition: transform 0.2s; color: #666; }
.filter-chevron.open { transform: rotate(180deg); }
.filter-content {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #1f1f1f;
    padding-top: 1.25rem;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-end;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 160px;
}
.filter-field label { font-size: 0.78rem; color: #777; font-weight: 500; }
.filter-actions { display: flex; gap: 0.5rem; align-items: flex-end; }

/* ===== Results header ===== */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.results-count { color: #666; font-size: 0.875rem; }

/* ===== Events Grid ===== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* ===== Event Card ===== */
.event-card {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.event-card:hover {
    transform: translateY(-4px);
    border-color: #b91c1c;
    box-shadow: 0 8px 32px rgba(185,28,28,0.15);
}
.event-card-img { width: 100%; height: 180px; object-fit: cover; }
.event-card-img-placeholder {
    width: 100%; height: 180px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #111);
    font-size: 3rem;
    color: #333;
}
.event-card-body { padding: 1rem 1.1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.event-card-body h3 { margin: 0.3rem 0 0.5rem; font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.3; }
.event-date, .event-venue { margin: 0.2rem 0; font-size: 0.82rem; color: #777; }
.event-bands { margin: 0.3rem 0 0; font-size: 0.8rem; color: #666; }
.event-card-footer { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; padding-top: 0.75rem; align-items: center; }

/* ===== Event Detail ===== */
.event-detail { max-width: 860px; margin: 0 auto; }
.event-detail-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin-bottom: 1.5rem; }
.event-detail-body h1 { font-size: 2rem; font-weight: 800; color: #fff; margin: 0.5rem 0; letter-spacing: -0.5px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.event-meta span { color: #888; font-size: 0.9rem; }
.bands, .genres { margin: 1rem 0; }
.bands h3 { color: #ccc; margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; }
.description { color: #bbb; line-height: 1.7; margin: 1.5rem 0; font-size: 0.95rem; }
.btn-back {
    background: none; border: 1px solid #2a2a2a; color: #888;
    padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; margin-top: 2rem;
    font-size: 0.875rem; transition: all 0.2s;
}
.btn-back:hover { border-color: #f87171; color: #f87171; }

/* ===== Badges & Tags ===== */
.badge {
    display: inline-block;
    background: rgba(185,28,28,0.2);
    color: #f87171;
    border: 1px solid rgba(185,28,28,0.4);
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.tag {
    display: inline-block;
    background: #1a1a1a;
    color: #888;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid #2a2a2a;
}
.tag.genre { background: rgba(99,102,241,0.1); color: #818cf8; border-color: rgba(99,102,241,0.2); }
.free { color: #4ade80; font-size: 0.82rem; font-weight: 700; }
.price { color: #fbbf24; font-size: 0.82rem; font-weight: 700; }

/* ===== Forms ===== */
.form-input {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: #b91c1c; background: #1f1f1f; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 160px; }
.form-group label { font-size: 0.8rem; color: #777; font-weight: 500; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===== Auth & Submit forms ===== */
.auth-container, .form-container {
    max-width: 460px;
    margin: 3rem auto;
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 14px;
    padding: 2rem;
}
.auth-container h2, .form-container h2 { color: #f87171; margin-top: 0; font-weight: 800; }
.form-container .subtitle { color: #666; margin-top: -0.5rem; margin-bottom: 1.5rem; font-size: 0.875rem; }
.auth-footer { text-align: center; color: #666; margin-top: 1rem; font-size: 0.875rem; }
.auth-footer a { color: #f87171; text-decoration: none; }
.auth-container .form-group, .form-container .form-group { margin-bottom: 1rem; }
.checkbox-group { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }

/* ===== Buttons ===== */
.btn-primary {
    background: #b91c1c;
    color: #fff;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    margin-top: 0.5rem;
}
.btn-primary:hover:not(:disabled) { background: #991b1b; transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #2a2a2a;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.btn-secondary:hover { border-color: #444; color: #fff; }
.btn-link {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    transition: color 0.2s;
}
.btn-link:hover { color: #fff; }

/* ===== Alerts ===== */
.alert-error {
    background: rgba(185,28,28,0.1);
    border: 1px solid rgba(185,28,28,0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-success {
    background: rgba(22,163,74,0.1);
    border: 1px solid rgba(22,163,74,0.3);
    color: #86efac;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

/* ===== Loading & Empty ===== */
.events-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem;
    gap: 1rem;
    color: #555;
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid #222;
    border-top-color: #b91c1c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #555;
}
.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { color: #777; margin: 0 0 0.5rem; font-weight: 600; }
.empty-state p { margin: 0; font-size: 0.875rem; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.page-btn {
    background: #111;
    color: #888;
    border: 1px solid #222;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 40px;
}
.page-btn:hover:not(:disabled) { border-color: #b91c1c; color: #f87171; }
.page-btn.active { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ===== Account Type Selector ===== */
.account-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
}
.type-btn:hover { border-color: #444; color: #ccc; }
.type-btn.active { border-color: #b91c1c; background: rgba(185,28,28,0.08); color: #fff; }
.type-icon { font-size: 1.75rem; }
.type-label { font-weight: 700; font-size: 0.95rem; }
.type-desc { font-size: 0.75rem; color: #666; }
.type-btn.active .type-desc { color: #999; }
.promoter-notice {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    color: #a5b4fc;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* ===== Admin Tabs ===== */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #1f1f1f;
}
.admin-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.admin-tab:hover { color: #ccc; }
.admin-tab.active { color: #f87171; border-bottom-color: #f87171; }

/* ===== Admin ===== */
.admin-container { max-width: 860px; margin: 0 auto; }
.admin-container h2 { color: #f87171; font-weight: 800; }
.submission-card {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s;
}
.submission-card:hover { border-color: #2a2a2a; }
.submission-header h3 { color: #fff; margin: 0.25rem 0 0.5rem; font-size: 1.1rem; font-weight: 700; }
.submission-meta { color: #666; font-size: 0.82rem; margin: 0.2rem 0; }
.submission-desc { color: #888; font-size: 0.875rem; margin: 0.75rem 0; line-height: 1.6; }
.submission-by { color: #555; font-size: 0.78rem; margin-top: 0.75rem; }
.submission-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #1f1f1f; }
.action-buttons { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.btn-approve {
    background: rgba(22,163,74,0.1); color: #4ade80;
    border: 1px solid rgba(22,163,74,0.3);
    padding: 0.5rem 1.25rem; border-radius: 8px; cursor: pointer;
    font-weight: 600; font-size: 0.875rem; transition: all 0.2s;
}
.btn-approve:hover:not(:disabled) { background: rgba(22,163,74,0.2); }
.btn-reject {
    background: rgba(185,28,28,0.1); color: #fca5a5;
    border: 1px solid rgba(185,28,28,0.3);
    padding: 0.5rem 1.25rem; border-radius: 8px; cursor: pointer;
    font-weight: 600; font-size: 0.875rem; transition: all 0.2s;
}
.btn-reject:hover:not(:disabled) { background: rgba(185,28,28,0.2); }
.btn-approve:disabled, .btn-reject:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-value.pending { color: #fbbf24; }
.stat-label { font-size: 0.75rem; color: #666; font-weight: 500; }

/* ===== Events Admin List ===== */
.admin-events-list { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-event-row {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.admin-event-row.cancelled { opacity: 0.5; }
.admin-event-info { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.admin-event-info strong { color: #fff; font-size: 0.95rem; }
.admin-event-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.status-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}
.status-badge.approved { background: rgba(22,163,74,0.1); color: #4ade80; }
.status-badge.cancelled { background: rgba(185,28,28,0.1); color: #fca5a5; }
.status-badge.pendingReview, .status-badge.pendingreview { background: rgba(251,191,36,0.1); color: #fbbf24; }

/* ===== Create Event Form ===== */
.create-event-form { max-width: 700px; }
.genres-checkboxes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.genre-check {
    display: flex; align-items: center; gap: 0.35rem;
    background: #1a1a1a; border: 1px solid #2a2a2a;
    padding: 0.3rem 0.7rem; border-radius: 20px;
    font-size: 0.8rem; color: #888; cursor: pointer;
    transition: all 0.15s;
}
.genre-check:has(input:checked) { border-color: #b91c1c; color: #f87171; background: rgba(185,28,28,0.08); }
.genre-check input { display: none; }

/* ===== Users Table ===== */
.users-table { overflow-x: auto; }
.users-table table { width: 100%; border-collapse: collapse; }
.users-table th {
    text-align: left; color: #555; font-size: 0.78rem;
    font-weight: 600; padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #1f1f1f; text-transform: uppercase; letter-spacing: 0.05em;
}
.users-table td { padding: 0.75rem; border-bottom: 1px solid #111; font-size: 0.875rem; color: #ccc; }
.users-table td strong { color: #fff; }
.users-table td.muted { color: #555; }
.users-table tr:hover td { background: #0f0f0f; }
.inactive-row td { opacity: 0.5; }
.role-badge {
    font-size: 0.7rem; padding: 0.2rem 0.55rem; border-radius: 20px; font-weight: 600;
}
.role-badge.admin { background: rgba(245,158,11,0.15); color: #fbbf24; }
.role-badge.promoter { background: rgba(99,102,241,0.15); color: #818cf8; }
.role-badge.pendingpromoter { background: rgba(251,191,36,0.1); color: #fbbf24; }
.role-badge.user { background: #1a1a1a; color: #666; }
.status-active { color: #4ade80; font-size: 0.8rem; font-weight: 600; }
.status-inactive { color: #555; font-size: 0.8rem; }
.btn-small { padding: 0.3rem 0.75rem; border-radius: 6px; cursor: pointer; font-size: 0.78rem; font-weight: 600; border: 1px solid; }
.btn-approve-sm { background: rgba(22,163,74,0.1); color: #4ade80; border-color: rgba(22,163,74,0.3); }
.btn-reject-sm { background: rgba(185,28,28,0.1); color: #fca5a5; border-color: rgba(185,28,28,0.3); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .navbar { padding: 0 1rem; }
    .content { padding: 1.25rem 1rem; }
    .hero { padding: 3rem 1rem 2.5rem; }
    .events-grid { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; }
    .form-row { flex-direction: column; }
    .auth-container, .form-container { margin: 1.5rem 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-tabs { overflow-x: auto; white-space: nowrap; }
    .admin-event-row { flex-direction: column; align-items: flex-start; }
    .nav-links { gap: 0.85rem; font-size: 0.85rem; }
}

/* ===== Blazor error UI ===== */
#blazor-error-ui {
    background: #1a0000;
    border-top: 2px solid #b91c1c;
    bottom: 0; left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed; width: 100%; z-index: 1000;
    display: none; color: #fca5a5; font-size: 0.875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #1a0000; padding: 1rem; color: #fca5a5; border-radius: 8px; }
.blazor-error-boundary::after { content: "Ocorreu um erro." }

.loading-progress {
    position: absolute; display: block;
    width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle {
    fill: none; stroke: #1a1a1a;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #b91c1c;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "A carregar"); }

.valid.modified:not([type=checkbox]) { outline: 1px solid #4ade80; }
.invalid { outline: 1px solid #f87171; }
.validation-message { color: #f87171; font-size: 0.8rem; }
