:root {
    --primary: #ff0077;
    --primary-glow: rgba(255, 0, 119, 0.5);
    --secondary: #2d9cdb;
    --accent: #f2994a;
    --bg-dark: #0a0a0c;
    --bg-card: #16161a;
    --text-main: #ffffff;
    --text-dim: #b0b0b0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    /* Layout for Dashboard */
    display: flex;
    min-height: 100vh;
}

/* Gradient Background Animation */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 0, 119, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: move-bg 20s infinite alternate linear;
}

@keyframes move-bg {
    from {
        transform: translate(-10%, -10%);
    }

    to {
        transform: translate(10%, 10%);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* Sidebar & Dashboard Layout */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--bg-card);
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    z-index: 100;
    overflow-y: auto;
}

.main-content {
    margin-left: 250px;
    padding: 2rem;
    width: calc(100% - 250px);
    min-height: 100vh;
    flex: 1;
}

/* Sidebar Links */
.sidebar a.active-link {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    width: 100%;
    border-radius: 6px;
    padding: 10px;
}

.sidebar a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    display: block;
    font-size: 1rem;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.sidebar a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}


/* --- DASHBOARD STYLES (Existing + Consolidated) --- */
.btn-new {
    background: var(--primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* PUBLIC EVENT GRID (New Horizontal Carousel) */
.event-grid {
    display: flex;
    /* Changed from grid to flex for horizontal layout */
    overflow-x: auto;
    gap: 20px;
    padding: 20px 5%;
    max-width: 100%;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    padding-bottom: 40px;
    /* Space for scrollbar or shadow */
}

/* Scrollbar Styling */
.event-grid::-webkit-scrollbar {
    height: 8px;
}

.event-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.event-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.event-card {
    background: #16161a;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;

    /* Carousel Specifics - Responsive Logic */
    flex-shrink: 0;
    scroll-snap-align: start;

    /* Mobile Default (Preserving "Perfect" state) */
    width: 85vw;
    max-width: 340px;
    min-width: 280px;
}

/* DESKTOP EXPANSION: Cards grow with screen size */
@media (min-width: 1024px) {
    .event-card {
        width: 16vw;
        /* Scales with viewport width (approx 5-6 cards visible) */
        max-width: none;
        /* Removed limit so they keep expanding */
        min-width: 280px;
        /* Prevent getting too thin */
    }
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.event-img {
    height: 380px;
    /* Taller Image for Vertical/Poster Look */
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.3s;
}

.event-card:hover .event-img {
    transform: scale(1.05);
    /* Zoom effect on hover */
}

.event-info {
    padding: 20px;
    background: linear-gradient(180deg, #16161a 0%, #0a0a0c 100%);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-date {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #fff;
}

.event-location {
    color: #888;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* LEGACY LOCAL CARD (Keep for compatibility if needed, but we encourage new style) */
.card-local {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s;
}

.card-local:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-local h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #fff;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    padding-right: 160px;
    /* INCREASED from 80px to fix overlap */
    word-wrap: break-word;
}

.card-local p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
}

.btn-delete:hover {
    background: #ff4d4d;
}

.success-msg {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.error-msg {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--glass-border);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

input,
select {
    width: 100%;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

/* Fix for readable options in dropdowns */
select option {
    background-color: var(--bg-card);
    color: #fff;
}

.btn-save {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
}

h3.section-title {
    color: #fff;
    font-size: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
    margin: 1.5rem 0 1rem 0;
    grid-column: 1 / -1;
}


/* --- NEW DASHBOARD CARD STYLE (Standardized from organizadores.php) --- */
.card-dashboard {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: transform 0.2s, border-color 0.2s;
}

.card-dashboard:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-dashboard h2 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.card-dashboard .info {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-dashboard .info p {
    margin: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-dashboard-actions {
    display: flex;
    flex-direction: row !important;
    /* FORCE Horizontal */
    flex-wrap: nowrap !important;
    /* FORCE No Wrapping */
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* Ensure forms inside actions also behave as flex containers sharing space */
.card-dashboard-actions form {
    flex: 1;
    display: flex;
    margin: 0;
}

.card-dashboard-actions a,
.card-dashboard-actions button,
.card-dashboard-actions form button {
    flex: 1;
    min-width: 0;
    /* Allow shrinking below content size if needed */
    /* Make sure all buttons divide the space */
    /* width: 100%; REMOVED to avoid wrapping */
}

.card-dashboard-actions .btn-dashboard {
    height: 40px;
    padding: 0;
    flex: 1;
    /* Divide space equally */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Slightly squarer than 6px maybe? 8px is good. */
}

.btn-dashboard {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
}

.btn-dashboard:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-dashboard-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid transparent;
}

.btn-dashboard-info {
    background: #2d9cdb;
    /* Blue - Secondary */
    color: #fff;
    border: 1px solid transparent;
}

.btn-dashboard-dark {
    background: #333;
    color: #fff;
    border: 1px solid #444;
}

.btn-dashboard-dark:hover {
    background: #444;
    border-color: #555;
}

.btn-dashboard-danger {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-dashboard-danger:hover {
    background: #e74c3c;
    color: #fff;
}

/* Responsive Button Text */
@media (max-width: 900px) {
    .btn-dashboard .btn-label {
        display: none;
    }

    .btn-dashboard {
        padding: 0.6rem;
        justify-content: center;
    }
}


/* Helper for mobile responsiveness if needed */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}