@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --sidebar-bg: #1e1e2d;
    --sidebar-hover: #2b2b40;
    --text-main: #333;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --success: #06d6a0;
    --danger: #f72585;
    --warning: #ff9f43;
    --shadow: 0 4px 20px 0 rgba(0,0,0,0.05);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header & Nav */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Admin Wrapper Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.sidebar h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
    color: var(--success);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
}

.sidebar ul li a {
    color: #a2a3b7;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background-color: var(--sidebar-hover);
    color: white;
    transform: translateX(5px);
}

.sidebar hr {
    border: 0;
    border-top: 1px solid #2b2b40;
    margin: 1.5rem 0;
}

/* Main Content area */
.main-content {
    flex: 1;
    padding: 2rem;
    width: 100%;
}

/* Cards */
.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.03);
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #fcfdfe;
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f3f9;
}

th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Status Badges */
.status-sold { 
    background-color: #ffe5ec; 
    color: var(--danger); 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 0.8rem;
    font-weight: 700;
}

.status-available { 
    background-color: #e0f9f2; 
    color: #06d6a0; 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 0.8rem;
    font-weight: 700;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.alert-info { background: #e7f3ff; color: #004085; }
.alert-error { background: #fdeaea; color: #721c24; }

/* Responsive Media Queries */
@media (max-width: 992px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }
    .sidebar h3 { margin-bottom: 1rem; }
    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .sidebar ul li { margin-bottom: 0; }
    .sidebar hr { display: none; }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    .nav-links {
        justify-content: center;
        width: 100%;
    }
    .container {
        margin: 1rem auto;
    }
    .card {
        padding: 1rem;
    }
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Ticket Grid & Cards */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
    width: 100%;
}

@media (max-width: 1800px) {
    .ticket-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (max-width: 1500px) {
    .ticket-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1200px) {
    .ticket-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .ticket-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .ticket-grid { grid-template-columns: 1fr; }
}

.ticket-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative; /* For numbering badge */
}

.ticket-number-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    box-shadow: 0 2px 5px rgba(67, 97, 238, 0.2);
    z-index: 10;
    border: 2px solid white;
}

.ticket-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.ticket-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.ticket-route {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--sidebar-bg);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.ticket-body {
    padding: 0.8rem;
    flex-grow: 1;
}

.ticket-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.ticket-info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.ticket-info-value {
    color: var(--text-main);
    font-weight: 700;
}

.ticket-price-tag {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin: 0.5rem 0;
}

.ticket-footer {
    padding: 0.8rem;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-full {
    width: 100%;
    display: block;
    padding: 0.5rem;
    font-size: 0.8rem;
}

.ticket-sold-overlay {
    position: relative;
}

.ticket-sold-overlay::after {
    content: "SOLD OUT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 2rem;
    font-weight: 900;
    color: rgba(247, 37, 133, 0.2);
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ticket-card {
    animation: fadeIn 0.5s ease backwards;
}
