/* Custom Color Variables */
:root {
    --primary-color: #003FA2;
    --secondary-color: #D15460;
    --background-color: #ffffff;
    --text-color: #333333;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Navbar (anonymous users) */
.navbar {
    background-color: var(--primary-color) !important;
    padding: 1rem 0;
}

.navbar-brand, .navbar-nav .nav-link {
    color: white !important;
}

.navbar-nav .nav-link:hover {
    color: var(--light-gray) !important;
}

/* ===== Sidebar (authenticated users) ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: var(--secondary-color);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

/* Sidebar footer / user section */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 0.5rem 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.sidebar-user-info:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-user-chevron {
    font-size: 0.7rem;
    transition: transform 0.25s;
}

.sidebar-user-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-user-menu li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem 0.5rem 2.75rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-user-menu li a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-user-menu li a.text-danger {
    color: #ff8a8a;
}

.sidebar-user-menu li a.text-danger:hover {
    color: #ff5555;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

.sidebar-overlay.active {
    display: block;
}

/* Topbar (always visible) */
.topbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 64px;
    background: var(--primary-color);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.22);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.topbar-brand {
    display: flex;
    align-items: center;
}

/* Topbar nav links */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.5rem;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.topbar-nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.topbar-nav-link.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 500;
}

/* Topbar user dropdown info line */
.topbar-user-info {
    font-size: .8rem;
}

/* Topbar divider */
.topbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

/* Topbar user dropdown */
.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.topbar-user-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.topbar-user-btn:hover,
.topbar-user-btn:focus,
.topbar-user-btn.show {
    background: rgba(255,255,255,0.15);
    color: #fff;
    outline: none;
    box-shadow: none;
}

.topbar-user-btn .fa-chevron-down {
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.topbar-user-btn.show .fa-chevron-down {
    transform: rotate(180deg);
}

/* Main wrapper */
.main-wrapper {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Desktop sidebar collapse */
@media (min-width: 992px) {
    .sidebar.desktop-collapsed {
        transform: translateX(-100%);
    }
    .main-wrapper.desktop-collapsed {
        margin-left: 0;
    }
}

.main-content-padding {
    padding: 1.5rem 2rem;
}

/* Responsive: sidebar collapses on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #004099;
    border-color: #004099;
}

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

.btn-secondary:hover {
    background-color: #a50e0e;
    border-color: #a50e0e;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
}

/* Event Cards */
.event-card {
    transition: transform 0.2s ease-in-out;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.event-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-draft {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 85, 198, 0.25);
}

.form-group {
    margin-bottom: 1rem;
}

/* Tables */
.table {
    background-color: var(--background-color);
}

.table th {
    background-color: var(--light-gray);
    color: var(--text-color);
    border-top: none;
}

/* Alerts */
.alert-primary {
    background-color: rgba(0, 85, 198, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.alert-secondary {
    background-color: rgba(206, 18, 18, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #0066e6);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Ticket Purchase */
.ticket-type {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.ticket-type:hover {
    border-color: var(--primary-color);
}

.ticket-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Dashboard */
.dashboard-card {
    text-align: center;
    padding: 2rem;
}

.dashboard-card .card-title {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--light-gray);
    color: var(--text-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }

    .main-content-padding {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .dashboard-card .card-title {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 85, 198, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Print Styles for Tickets */
@media print {
    body {
        font-family: Arial, sans-serif;
    }
    
    .no-print {
        display: none !important;
    }
    
    .ticket {
        page-break-inside: avoid;
        border: 2px solid var(--primary-color);
        padding: 1rem;
        margin: 1rem 0;
    }
}