@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-color: #00ff88;
    --secondary-color: #0088ff;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.05) 0%, transparent 50%),
                radial-gradient(circle at bottom right, rgba(0, 136, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: pulseBg 15s infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

header {
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    line-height: 0;
}

.logo-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: rgba(0, 255, 136, 0.1);
    border: 1.5px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px 12px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
    background: rgba(0, 255, 136, 0.22);
}

.logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    transition: opacity 0.3s ease;
}

.logo img:hover {
    opacity: 0.85;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

main {
    flex: 1;
    padding: 50px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 80px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: '';
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    margin-left: 20px;
}

/* Event Cards */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
}

.event-img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: #0f172a;
    border-bottom: 1px solid var(--border-glass);
    transition: transform 0.5s ease;
}

.event-card:hover .event-img {
    transform: scale(1.05);
}

.img-wrapper {
    overflow: hidden;
}

.event-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.event-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.event-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.5;
    flex: 1;
}

.btn-inscrever {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    background: linear-gradient(90deg, var(--primary-color), #00cc6a);
    color: var(--bg-dark);
    text-decoration: none;
    font-weight: 800;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-inscrever:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transform: scale(1.02);
}

.btn-inscrever.disabled {
    background: #334155;
    color: #94a3b8;
    pointer-events: none;
    box-shadow: none;
}

/* Forms */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

select.form-control option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.alert-danger {
    background: rgba(255, 0, 85, 0.1);
    color: #ff0055;
    border: 1px solid #ff0055;
}

footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    margin-top: auto;
}

/* Admin Dashboard Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.admin-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--primary-color);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* ── Tablet ≤ 900px ─────────────────────────────────── */
@media (max-width: 900px) {
    header {
        padding: 16px 24px;
    }

    .logo-title {
        font-size: 1.3rem;
    }

    main {
        padding: 36px 24px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
}

/* ── Mobile ≤ 640px ──────────────────────────────────── */
@media (max-width: 640px) {
    header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 0;
    }

    .logo {
        flex: 1;
    }

    .logo-title {
        display: none;
    }

    .nav-toggle {
        display: block;
        margin-left: auto;
    }

    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.99);
        border-top: 2px solid var(--primary-color);
        padding: 4px 0 8px;
        order: 3;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }

    nav.nav-open {
        display: flex;
    }

    nav a {
        margin-left: 0;
        padding: 14px 20px;
        border-bottom: 1px solid var(--border-glass);
        font-size: 1rem;
        letter-spacing: 0.02em;
    }

    nav a:last-child {
        border-bottom: none;
    }

    nav a:active {
        background: rgba(0, 255, 136, 0.08);
    }

    main {
        padding: 24px 16px;
    }

    .hero {
        margin-bottom: 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-container {
        padding: 24px 16px;
    }

    /* Admin table → cards */
    .admin-table thead {
        display: none;
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        background: var(--bg-card);
        border: 1px solid var(--border-glass);
        border-radius: 12px;
        margin-bottom: 14px;
        padding: 4px 0;
    }

    .admin-table tr:hover td {
        background: transparent;
    }

    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border-glass);
        text-align: right;
        font-size: 0.88rem;
        min-height: 40px;
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary-color);
        text-align: left;
        flex-shrink: 0;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .admin-table td:empty {
        display: none;
    }
}

/* ── Chave Pix ───────────────────────────────────────── */
.pix-box {
    background: rgba(0,255,136,0.1);
    border: 1px dashed var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    font-size: clamp(0.85rem, 3.5vw, 1.2rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    word-break: break-all;
    user-select: all;
    text-align: center;
}

.btn-copiar-pix {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0,255,136,0.12);
    border: 1.5px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 15px;
}

.btn-copiar-pix:hover {
    background: rgba(0,255,136,0.22);
}

.btn-copiar-pix.copiado {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,0.12);
}

/* ── Admin Design System ─────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost, .btn-warning, .btn-danger, .btn-teal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), #00cc6a);
    color: var(--bg-dark);
}
.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(0, 136, 255, 0.15);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.btn-secondary:hover {
    background: var(--secondary-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.4);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: #f59e0b;
}
.btn-warning:hover {
    background: #f59e0b;
    color: #fff;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.btn-danger {
    background: rgba(255, 0, 85, 0.15);
    color: #ff5577;
    border-color: #ff5577;
}
.btn-danger:hover {
    background: #ff5577;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.btn-teal {
    background: linear-gradient(90deg, #0e7490, #06b6d4);
    color: #fff;
}
.btn-teal:hover {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
    transform: scale(1.02);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-full {
    width: 100%;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.badge-pendente { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.badge-pago { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid #10b981; }
.badge-cancelado { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid #ef4444; }

.badge-filiado { background: rgba(0, 255, 136, 0.12); color: var(--primary-color); border: 1px solid var(--primary-color); }
.badge-nao-filiado { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid #475569; }

.badge-aberto { background: rgba(0, 255, 136, 0.15); color: var(--primary-color); border: 1px solid var(--primary-color); }
.badge-encerrado { background: rgba(255, 0, 85, 0.15); color: #ff5577; border: 1px solid #ff5577; }
.badge-futuro { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.badge-realizado { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid #94a3b8; }

/* Utilitários Responsivos e Componentes Administrativos */
.manage-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

@media (max-width: 900px) {
    .manage-grid {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.panel-card h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.info-row:last-child {
    border-bottom: none;
}

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

.info-value {
    color: var(--text-main);
    font-weight: 600;
}

.btn-full {
    width: 100%;
    display: block;
    text-align: center;
}

/* Modal Overlay e Container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background: var(--bg-dark);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.15);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #ef4444;
}

/* Forçar quebra em tabelas para o mobile (evitar overflow) */
.admin-table td {
    word-break: break-word;
}
