/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

/* Reset e estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #caa52d;
    --primary-dark: #a88a1f;
    --secondary-color: #e0c060;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #f0f0f0;
    --text-light: #a0a0a0;
    --bg-light: #111110;
    --bg-white: #1c1c1c;
    --border-color: #2a2a2a;
    --bg-sidebar: #0d0b06;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --radius: 8px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #0d0b06, #1a1a1a);
    color: var(--text-dark);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Botões */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #0d0b06;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: #c9a828;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-warning {
    background-color: #b45309;
    color: #fef3c7;
}

.btn-warning:hover {
    background-color: #92400e;
}

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #0d0b06;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: #0d0d0d;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(202, 165, 45, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Select styling for dark theme */
select.form-control option {
    background-color: #1c1c1c;
    color: #f0f0f0;
}

/* Code tag styling */
code {
    background-color: #0a0a0a;
    color: var(--primary-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Selection colors */
::selection {
    background-color: var(--primary-color);
    color: #0d0b06;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: #0d0b06;
}

/* Layout da página de evento (detalhe + compra) */
.evento-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .evento-layout {
        grid-template-columns: 1fr;
    }
    
    .card-sticky {
        position: static !important;
    }
}
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.event-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s;
}

.event-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #0a0a0a;
}

.event-content {
    padding: 1.5rem;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.event-date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-location {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.event-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: #0d0b06;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #064e3b;
    color: #6ee7b7;
}

.badge-warning {
    background-color: #78350f;
    color: #fcd34d;
}

.badge-danger {
    background-color: #7f1d1d;
    color: #fca5a5;
}

.badge-info {
    background-color: #1e3a5f;
    color: #93c5fd;
}

/* Tabelas */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    table-layout: auto;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
}

.table th {
    background-color: #0a0a0a;
    font-weight: 600;
    color: var(--primary-color);
}

.table tbody tr:hover {
    background-color: #252525;
}

/* Wrapper responsivo para tabelas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    max-width: 100%;
}

.table-responsive .table {
    margin-bottom: 0;
    min-width: 760px;
}

/* Grid de 2 colunas responsivo */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2 {
        gap: 1.5rem;
    }

    .grid-2 .card,
    .admin-content .card {
        min-width: 0;
        overflow: hidden;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .admin-content .card {
        padding: 1rem;
    }
}

/* Main content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Footer */
footer {
    background-color: #0a0a0a;
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Alert messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #064e3b;
    color: #6ee7b7;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #78350f;
    color: #fcd34d;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #1e1a0c;
    color: #f0d060;
    border-left: 4px solid var(--primary-color);
}

/* Loading spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Admin sidebar */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Topbar mobile com hamburguer */
.admin-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: #0d0b06;
    color: var(--text-dark);
    padding: 0 1rem;
    z-index: 110;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--primary-color);
}

.admin-topbar .menu-toggle {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-topbar .menu-toggle:hover {
    background-color: rgba(202, 165, 45, 0.15);
}

.admin-topbar .topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    color: var(--text-dark);
    padding: 2rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
    border-right: 1px solid #2a2a2a;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    margin-bottom: 0;
}

.sidebar-header .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.3s;
}

.sidebar-header .menu-toggle:hover {
    background-color: rgba(202, 165, 45, 0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-menu {
    list-style: none;
    margin-top: 2rem;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(202, 165, 45, 0.15);
    color: var(--primary-color);
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 250px);
    overflow-x: hidden;
    min-width: 0;
}

@media (max-width: 768px) {
    .admin-topbar {
        display: flex;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        padding-top: 1rem;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }
    
    .admin-content {
        margin-left: 0;
        padding: calc(56px + 1rem) 1rem 1rem;
        max-width: 100vw;
        overflow-x: hidden;
        min-width: 0;
    }

    /* Grid de cards de estatísticas - evitar overflow */
    .admin-content > div[style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"],
    .admin-content > div[style*="grid-template-columns: repeat(auto-fit, minmax"] {
        grid-template-columns: 1fr !important;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--primary-color);
}
