/* ===================================================
   ESACE Eventos — CSS Compartilhado (Light Platform Theme)
   =================================================== */

/* --- CSS Variables (Platform Palette) --- */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --primary-soft: #818CF8;

    --secondary: #0F172A;
    --secondary-light: #334155;

    --accent: #F43F5E;
    --accent-light: #FFF1F2;

    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #10B981;
    --success-light: #ECFDF5;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

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

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25);
}

.btn-primary:not(:disabled):hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 15px -3px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-secondary:not(:disabled):hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-main);
}

.btn-outline:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* Legacy support */
.btn-neon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius-full); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.25s ease; }
.btn-neon-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.25); }
.btn-neon-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-neon-secondary { background: var(--secondary); color: #fff; }
.btn-neon-secondary:hover { background: #1e293b; transform: translateY(-1px); }
.btn-neon-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-neon-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* --- Cards --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
}

.card-glass {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glass:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
}

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-live {
    background: var(--danger-light);
    color: var(--danger);
    animation: pulse-live 2s ease-in-out infinite;
}

.badge-upcoming {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-ended {
    background: var(--border-light);
    color: var(--text-light);
}

.badge-free {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Inputs --- */
.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.input-field::placeholder {
    color: var(--text-light);
}

/* Legacy .input-dark maps to .input-field */
.input-dark {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-dark:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.input-dark::placeholder {
    color: var(--text-light);
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    z-index: 9999;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: var(--shadow-xl);
    animation: toast-in 0.4s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modal-enter 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-box h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
    color: var(--secondary);
}

.modal-box input,
.modal-box textarea,
.modal-box select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.modal-box input:focus,
.modal-box textarea:focus,
.modal-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.modal-box textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.modal-btns button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-confirm {
    background: var(--primary);
    color: #fff;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

.btn-cancel {
    background: var(--border-light);
    color: var(--text-muted);
}

.btn-cancel:hover {
    background: var(--border);
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Error Box --- */
.error-box {
    background: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

/* --- Spinner --- */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 50px auto;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
    display: none;
}

.spinner-inline {
    width: 18px;
    height: 18px;
    border-width: 2px;
    border-top-color: #fff;
    display: inline-block;
    margin: 0;
}

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

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Logo --- */
.logo-eventos {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-eventos i {
    color: var(--primary);
}

/* --- Divider --- */
.divider {
    display: flex;
    align-items: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 15px;
}

/* --- Navbar --- */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* --- Requirement Items (participant) --- */
.req-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.req-item.fulfilled {
    border-color: rgba(16, 185, 129, 0.4);
    background: var(--success-light);
}

.req-item.pending {
    border-color: rgba(245, 158, 11, 0.3);
    background: var(--warning-light);
}

.req-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.req-icon.ok { background: var(--success-light); color: var(--success); }
.req-icon.wait { background: var(--warning-light); color: var(--warning); }
.req-icon.fail { background: var(--danger-light); color: var(--danger); }

.req-action {
    margin-left: auto;
}

.req-action button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s;
}

.req-action button:hover {
    background: var(--primary-dark);
}

/* --- QR Display --- */
.qr-container {
    text-align: center;
    padding: 24px;
}

.qr-container img {
    border-radius: var(--radius-md);
    background: #fff;
    padding: 12px;
    box-shadow: var(--shadow-md);
}

.qr-container p {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Countdown Timer --- */
.countdown {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.countdown-unit {
    text-align: center;
    min-width: 68px;
}

.countdown-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: block;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- Share Buttons --- */
.share-bar {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s;
}

.share-btn:hover {
    transform: translateY(-1px);
}

.share-whatsapp {
    background: #25D366;
    color: #fff;
}

.share-copy {
    background: var(--border-light);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.share-copy:hover {
    background: var(--border);
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    align-items: center;
}

.filter-bar .search-wrapper {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.filter-bar .search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.filter-bar .search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.filter-bar .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.filter-bar .search-input::placeholder {
    color: var(--text-light);
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Section Headers --- */
.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 40px;
}

.section-label h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
}

.section-label .count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- Stats Card --- */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
}

/* --- Tab Navigation --- */
.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-item {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

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

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

/* --- Event Card --- */
.event-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.event-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
}

.event-card-cover {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-soft);
    font-size: 2.5rem;
    overflow: hidden;
    position: relative;
}

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

.event-card-body {
    padding: 20px;
}

.event-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.event-card-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-card-meta i {
    width: 16px;
    color: var(--primary-soft);
}

.event-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.event-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .toast {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        text-align: center;
        font-size: 0.85rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .search-wrapper {
        width: 100%;
    }

    .filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .filter-chip {
        white-space: nowrap;
    }

    .countdown-value {
        font-size: 1.4rem;
        padding: 8px 10px;
    }

    .share-bar {
        flex-direction: column;
    }

    .share-btn {
        justify-content: center;
    }

    .modal-box {
        padding: 24px;
        width: 95%;
        max-height: 85vh;
    }

    .qr-container img {
        max-width: 200px;
    }

    .navbar-inner {
        height: 56px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-md);
    }

    .nav-links.show {
        display: flex;
    }
}

@media (max-width: 480px) {
    .countdown {
        gap: 8px;
    }

    .countdown-unit {
        min-width: 50px;
    }

    .countdown-value {
        font-size: 1.2rem;
    }

    .req-item {
        flex-wrap: wrap;
    }

    .req-action {
        margin-left: 0;
        width: 100%;
        margin-top: 6px;
    }

    .req-action button {
        width: 100%;
    }
}
