/**
 * tickets.drb.lat - Main Stylesheet
 * Clean, professional theme inspired by churchofjesuschrist.org
 */

:root {
    /* Primary Colors - Navy & Gold */
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --primary-dark: #142a45;

    /* Accent - Warm Gold */
    --accent: #c9a227;
    --accent-light: #ddb84d;
    --accent-dark: #a68620;

    /* Backgrounds - Light Theme */
    --bg-white: #ffffff;
    --bg-light: #f7f7f7;
    --bg-cream: #faf9f7;

    /* Text Colors */
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6b6b6b;
    --text-muted: #9a9a9a;

    /* Borders */
    --border: #e5e5e5;
    --border-light: #f0f0f0;

    /* Status Colors */
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f9a825;

    /* Gradient */
    --gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
    --gradient-gold: linear-gradient(135deg, var(--accent), var(--accent-light));

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* Radius */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Hero Section */
.hero {
    background: var(--gradient);
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

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

.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: block;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gradient);
}

.card-title,
.card-meta,
.card p,
.card button {
    padding-left: 24px;
    padding-right: 24px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-top: 20px;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.card button {
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-cream);
    border-color: var(--primary);
}

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

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

/* Seat Map */
.seat-map-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
}

.stage {
    background: var(--gradient);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.section-block {
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.section-block:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.section-block.selected {
    border-color: var(--accent);
}

.seats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-top: 20px;
}

.seat-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.row-label {
    width: 24px;
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.75rem;
}

.seat {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border: none;
    border-radius: 6px 6px 8px 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

.seat:hover:not(.sold):not(.selected) {
    background: var(--primary-light);
    transform: scale(1.1);
}

.seat.selected {
    background: var(--accent);
    transform: scale(1.1);
}

.seat.sold {
    background: var(--border);
    cursor: not-allowed;
    color: var(--text-muted);
}

/* Checkout */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    padding: 40px 0;
}

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

.checkout-form {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
}

.order-summary {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* Tickets */
.ticket {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.ticket-header {
    background: var(--gradient);
    color: white;
    padding: 20px;
    text-align: center;
}

.ticket-body {
    padding: 24px;
}

.ticket-qr {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    margin: 16px 0;
}

.ticket-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ticket-info-item {
    text-align: center;
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.ticket-info-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticket-info-item span {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.ticket-actions {
    display: flex;
    gap: 12px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background: rgba(198, 40, 40, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(198, 40, 40, 0.1);
    color: var(--danger);
}

/* Tables */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-cream);
}

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

/* Admin Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--primary);
    color: white;
    padding: 24px;
}

.admin-sidebar .logo {
    color: white;
    margin-bottom: 40px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.admin-content {
    padding: 30px;
    background: var(--bg-light);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 1.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.25rem;
}

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

.modal form {
    padding: 24px;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

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

    .ticket-info {
        grid-template-columns: repeat(3, 1fr);
    }
}