/* Multi-User Ticket Scanner & Validation System - Stylesheet */

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --text-color: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* === Navbar === */
.navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.user-info {
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border-radius: 0.5rem;
    font-weight: 500;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* === Login Page === */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: #f8fafc;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 1.875rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer p {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn.active {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* === Alerts === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* === Dashboard === */
.dashboard-header {
    text-align: left;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 1.875rem;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 0.75rem;
}

.stat-content h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stat-content p {
    margin: 0.25rem 0 0 0;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* === Cards === */
.dashboard-content {
    display: grid;
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.card-header h3 {
    font-size: 1.125rem;
    color: var(--dark-color);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* === Tables === */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table th {
    font-weight: 600;
    color: var(--dark-color);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--secondary-color);
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-valid {
    background: #d1fae5;
    color: #065f46;
}

.badge-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.badge-used {
    background: #fef3c7;
    color: #92400e;
}

/* === Scanner Interface === */
.scanner-container {
    max-width: 900px;
}

.scanner-header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.scanner-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.scanner-modes {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.scanner-mode {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.scanner-mode.active {
    display: block;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.camera-controls select {
    flex: 1;
    min-width: 200px;
}

.qr-reader {
    margin: 1rem auto;
    max-width: 600px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.qr-reader video {
    transform: scaleX(-1);
}

.manual-input-container {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.manual-input-container input {
    flex: 1;
}

/* === Result Display === */
.result-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.result-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
}

.result-card.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.result-card.success .result-header h2 {
    color: #065f46;
}

.result-card.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.result-card.error .result-header h2 {
    color: #991b1b;
}

.result-message {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.ticket-details {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.ticket-details p {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.ticket-details p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ticket-details strong {
    display: inline-block;
    min-width: 150px;
    color: var(--dark-color);
}

/* === Error Page === */
.error-page {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .scanner-modes {
        flex-direction: column;
    }

    .camera-controls {
        flex-direction: column;
    }

    .manual-input-container {
        flex-direction: column;
    }

    .login-box {
        padding: 1.5rem;
    }

    .dashboard-header h2 {
        font-size: 2rem;
    }
}

/* === Utilities === */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* === Loading Spinner === */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px 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); }
}
