/**
 * EZECHO 2026 Registration System — Base Styles
 * All brand colors come from ezecho-theme.css (--ez-* vars)
 * This file handles layout, components, mobile responsiveness
 */

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #2E2632;
    background-color: #FBF7F1;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Disable dark mode — conference app always light */
@media (prefers-color-scheme: dark) {
    html { color-scheme: light; }
    body { background-color: #FBF7F1 !important; color: #2E2632 !important; }
    .card { background-color: #fff !important; color: #2E2632 !important; }
    .form-control, .form-select {
        background-color: #fff !important;
        color: #2E2632 !important;
        border-color: #dee2e6 !important;
    }
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Segoe UI', serif;
    color: #2E2632;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); }
h3 { font-size: clamp(1.05rem, 2.5vw, 1.35rem); }
h4 { font-size: clamp(1rem, 2vw, 1.15rem); }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p { color: #444; }

a { color: #9A7642; }
a:hover { color: #BB9059; }

/* ==================== CONTENT WRAPPER ==================== */
.content-wrapper {
    padding: 1.5rem 0 3rem;
    min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .content-wrapper { padding: 1rem 0 2rem; }
    .container { padding-left: 0.85rem; padding-right: 0.85rem; }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FBF7F1; }
::-webkit-scrollbar-thumb { background: #BB9059; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9A7642; }

/* ==================== BUTTONS ==================== */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    min-height: 44px;
    padding: 0.6rem 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, #BB9059 0%, #9A7642 100%);
    color: #2E2632 !important;
    box-shadow: 0 4px 12px rgba(187,144,89,0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #D9B883 0%, #BB9059 100%);
    color: #2E2632 !important;
    box-shadow: 0 6px 18px rgba(187,144,89,0.45);
}

.btn-success {
    background: linear-gradient(135deg, #2e8b57 0%, #1d6b40 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(46,139,87,0.3);
}
.btn-success:hover { color: #fff !important; box-shadow: 0 6px 18px rgba(46,139,87,0.4); }

.btn-danger {
    background: linear-gradient(135deg, #b3434b 0%, #8c2c33 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(179,67,75,0.3);
}
.btn-danger:hover { color: #fff !important; }

.btn-warning {
    background: linear-gradient(135deg, #e8a020 0%, #c47d0a 100%);
    color: #2E2632 !important;
}
.btn-warning:hover { color: #2E2632 !important; }

.btn-info {
    background: linear-gradient(135deg, #2e7fb3 0%, #1a5f8c 100%);
    color: #fff !important;
}
.btn-info:hover { color: #fff !important; }

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: #fff !important;
}

.btn-outline-secondary {
    border: 2px solid #BB9059;
    color: #9A7642;
    background: transparent;
}
.btn-outline-secondary:hover {
    background: #BB9059;
    color: #2E2632 !important;
}

.btn-outline-danger {
    border: 2px solid #b3434b;
    color: #b3434b;
    background: transparent;
}
.btn-outline-danger:hover { background: #b3434b; color: #fff !important; }

.btn-light { background: #fff; color: #2E2632 !important; border: 1px solid #dee2e6; }
.btn-dark { background: #2E2632; color: #fff !important; }

.btn-lg {
    min-height: 52px;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-sm {
    min-height: 34px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 7px;
}

@media (max-width: 576px) {
    .btn { font-size: 0.85rem; padding: 0.55rem 1rem; }
    .btn-lg { min-height: 48px; font-size: 0.95rem; padding: 0.65rem 1.25rem; }
}

/* ==================== CARDS ==================== */
.card {
    border-radius: 16px;
    border: 1px solid rgba(187,144,89,0.2);
    box-shadow: 0 4px 16px rgba(46,38,50,0.07);
    background: #fff;
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 8px 24px rgba(46,38,50,0.12); }

.card-header {
    background: linear-gradient(135deg, #2E2632 0%, #3B313C 100%);
    color: #fff !important;
    font-weight: 600;
    padding: 0.9rem 1.25rem;
    border-bottom: 3px solid #BB9059;
    border-radius: 0 !important;
}
.card-header h4, .card-header h5, .card-header h6,
.card-header .mb-0 { color: #fff !important; font-family: 'Poppins', sans-serif; }
.card-header.bg-success { background: linear-gradient(135deg, #2e8b57 0%, #1d6b40 100%) !important; border-bottom-color: #52c98a; }
.card-header.bg-warning { background: linear-gradient(135deg, #e8a020 0%, #c47d0a 100%) !important; border-bottom-color: #f0c060; color: #2E2632 !important; }
.card-header.bg-warning h4, .card-header.bg-warning h5, .card-header.bg-warning h6 { color: #2E2632 !important; }
.card-header.bg-danger { background: linear-gradient(135deg, #b3434b 0%, #8c2c33 100%) !important; }
.card-header.bg-info { background: linear-gradient(135deg, #2e7fb3 0%, #1a5f8c 100%) !important; }
.card-header.bg-primary { background: linear-gradient(135deg, #2E2632 0%, #3B313C 100%) !important; }

.card-body { padding: 1.25rem; color: #2E2632; }
.card-footer { background: #faf7f3; padding: 0.85rem 1.25rem; border-top: 1px solid rgba(187,144,89,0.15); }

@media (max-width: 768px) {
    .card { border-radius: 12px; margin-bottom: 1rem; }
    .card-header { padding: 0.75rem 1rem; }
    .card-body { padding: 1rem; }
    .card-footer { padding: 0.75rem 1rem; }
}

/* ==================== STAT CARDS ==================== */
.stat-card {
    border-left: 5px solid #BB9059 !important;
    cursor: pointer;
    transition: border-left-width 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { border-left-width: 8px !important; }
.stat-card.stat-success { border-left-color: #2e8b57 !important; }
.stat-card.stat-warning { border-left-color: #e8a020 !important; }
.stat-card.stat-danger { border-left-color: #b3434b !important; }
.stat-card.stat-info { border-left-color: #2e7fb3 !important; }

.stat-value {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: #2E2632;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    color: #6b6270;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-icon { font-size: 1.8rem; opacity: 0.25; color: #2E2632; }

/* ==================== FORMS ==================== */
.form-label {
    font-weight: 600;
    color: #2E2632;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #dee2e6;
    min-height: 44px;
    font-size: 0.95rem;
    color: #2E2632;
    background-color: #fff;
    padding: 0.55rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #BB9059;
    box-shadow: 0 0 0 3px rgba(187,144,89,0.2);
    outline: none;
    color: #2E2632;
    background-color: #fff;
}

.form-control::placeholder { color: #aaa; }
.form-control-lg { min-height: 52px; font-size: 1rem; }
.form-select { cursor: pointer; }

.invalid-feedback { font-size: 0.8rem; color: #b3434b; }
.form-control.is-invalid { border-color: #b3434b; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(179,67,75,0.2); }

.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; min-height: 44px; }
.input-group-text {
    background: #f3ede8;
    border: 1.5px solid #dee2e6;
    color: #9A7642;
    font-weight: 600;
}

/* ==================== TABLES ==================== */
.table { font-size: 0.875rem; color: #2E2632; }
.table thead th {
    background: linear-gradient(135deg, #2E2632 0%, #3B313C 100%);
    color: #fff !important;
    font-weight: 600;
    padding: 0.85rem 0.75rem;
    white-space: nowrap;
    border: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tbody td { padding: 0.75rem; vertical-align: middle; color: #2E2632; }
.table tbody tr:hover { background-color: rgba(187,144,89,0.06); }
.table-responsive { border-radius: 12px; overflow: hidden; border: 1px solid rgba(187,144,89,0.2); }

@media (max-width: 768px) {
    .table { font-size: 0.8rem; }
    .table thead th, .table tbody td { padding: 0.6rem 0.5rem; }
}

/* ==================== BADGES / PILLS ==================== */
.badge {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.badge-delegate, .badge.bg-info { background: #2e7fb3 !important; color: #fff !important; }
.badge-faculty, .badge.bg-primary { background: #2E2632 !important; color: #BB9059 !important; }
.badge-invited-faculty { background: #6b3fa0 !important; color: #fff !important; }
.badge-industry { background: #2e8b57 !important; color: #fff !important; }
.badge-staff { background: #BB9059 !important; color: #2E2632 !important; }
.badge.bg-success { background: #2e8b57 !important; color: #fff !important; }
.badge.bg-warning { background: #e8a020 !important; color: #2E2632 !important; }
.badge.bg-danger { background: #b3434b !important; color: #fff !important; }
.badge.bg-secondary { background: #6c757d !important; color: #fff !important; }

/* ==================== ALERTS ==================== */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    padding: 0.85rem 1.1rem;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #2e8b57; }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid #b3434b; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #e8a020; }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #2e7fb3; }

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(90deg, #2E2632 0%, #3B313C 100%) !important;
    border-bottom: 3px solid #BB9059;
    box-shadow: 0 2px 12px rgba(46,38,50,0.3);
    padding: 0.6rem 1rem;
}
.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #D9B883 !important;
    font-weight: 700;
}
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #D9B883 !important;
    background: rgba(187,144,89,0.15);
}
.navbar-toggler {
    border: 1.5px solid rgba(187,144,89,0.5);
    padding: 0.35rem 0.6rem;
}
.navbar-toggler-icon { filter: invert(1); }

/* ==================== FOOTER ==================== */
footer, .footer {
    background: linear-gradient(90deg, #2E2632 0%, #3B313C 100%) !important;
    color: rgba(255,255,255,0.8) !important;
    border-top: 3px solid #BB9059;
    padding: 1.5rem 0;
}
footer *, .footer * { color: rgba(255,255,255,0.8); }
footer a, .footer a { color: #D9B883 !important; text-decoration: none; }
footer a:hover, .footer a:hover { color: #fff !important; }

/* ==================== LOGIN PAGES ==================== */
.login-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px !important;
    box-shadow: 0 12px 40px rgba(46,38,50,0.18) !important;
    overflow: hidden;
}

.login-card .card-header {
    padding: 1.5rem;
    text-align: center;
}

.login-card .card-header h4 {
    font-size: 1.3rem;
    margin: 0;
    color: #fff !important;
}

.login-card .card-body { padding: 1.75rem; }

@media (max-width: 480px) {
    .login-card { border-radius: 14px !important; }
    .login-card .card-body { padding: 1.25rem; }
}

/* ==================== SERVICE BUTTONS ==================== */
.service-btn {
    width: 100%;
    min-height: 56px;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: 12px !important;
    font-weight: 600;
    transition: all 0.2s ease;
}
.service-btn i { font-size: 1.3rem; }
.service-btn.completed { background: linear-gradient(135deg, #2e8b57, #1d6b40) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(46,139,87,0.3); }
.service-btn.pending { background: linear-gradient(135deg, #6c757d, #545b62) !important; color: #fff !important; }
.service-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.service-btn:disabled:hover { transform: none; }

@media (max-width: 576px) {
    .service-btn { min-height: 52px; font-size: 0.875rem; padding: 0.75rem 1rem; }
}

/* ==================== GUEST INFO ==================== */
.guest-info {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(46,38,50,0.07);
    border: 1px solid rgba(187,144,89,0.2);
}

.guest-id-display {
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 800;
    color: #2E2632;
    text-align: center;
    padding: 0.85rem;
    background: linear-gradient(135deg, #FBF7F1, #f3ede8);
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1.5px solid rgba(187,144,89,0.3);
    letter-spacing: 2px;
}

.guest-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(187,144,89,0.12);
    gap: 1rem;
}
.guest-detail-row:last-child { border-bottom: none; }
.guest-detail-label { font-weight: 600; color: #6b6270; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.guest-detail-value { font-weight: 600; color: #2E2632; text-align: right; font-size: 0.9rem; word-break: break-word; }

/* ==================== QR CODE ==================== */
.qr-code-container {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(46,38,50,0.07);
    border: 1px solid rgba(187,144,89,0.2);
}
.qr-code-container img { max-width: 200px; height: auto; border-radius: 8px; }

/* ==================== MANUAL ENTRY ==================== */
.manual-entry-container {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(46,38,50,0.07);
    border: 1px solid rgba(187,144,89,0.2);
}
.manual-entry-input {
    font-size: 1.1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

/* ==================== MODALS ==================== */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 12px 40px rgba(46,38,50,0.25);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(135deg, #2E2632 0%, #3B313C 100%);
    color: #fff;
    border-bottom: 3px solid #BB9059;
    padding: 1rem 1.25rem;
}
.modal-header .modal-title { color: #fff !important; font-size: 1rem; }
.modal-header .btn-close { filter: invert(1) brightness(2); }
.modal-body { padding: 1.25rem; color: #2E2632; }
.modal-footer { padding: 0.85rem 1.25rem; background: #faf7f3; border-top: 1px solid rgba(187,144,89,0.15); }

/* ==================== LOADING SPINNER ==================== */
.spinner-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(46,38,50,0.6); z-index: 9998;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(3px);
}
.spinner-overlay.active { display: flex; }
.spinner-border-custom {
    width: 3.5rem; height: 3.5rem;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #BB9059;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #D9B883; margin-top: 1rem; font-size: 1rem; font-weight: 600; }

/* ==================== TOASTS ==================== */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }
.toast {
    min-width: 280px; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(46,38,50,0.2);
    animation: slideIn 0.3s ease-out;
    border: none;
    overflow: hidden;
}
.toast-header { padding: 0.6rem 1rem; font-weight: 600; }
.toast.success .toast-header { background: #2e8b57; color: #fff; }
.toast.error .toast-header { background: #b3434b; color: #fff; }
.toast.warning .toast-header { background: #e8a020; color: #2E2632; }
.toast.info .toast-header { background: #2e7fb3; color: #fff; }
.toast-body { padding: 0.6rem 1rem; font-size: 0.875rem; color: #2E2632; background: #fff; }

@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 576px) {
    .toast-container { right: 0.5rem; left: 0.5rem; }
    .toast { min-width: auto; width: 100%; }
}

/* ==================== PROGRESS ==================== */
.progress { height: 1.25rem; border-radius: 10px; background: #e9ecef; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, #BB9059, #9A7642); transition: width 0.6s ease; }

/* ==================== EMPTY STATE ==================== */
.empty-state { text-align: center; padding: 3rem 1rem; color: #6b6270; }
.empty-state i { font-size: 3.5rem; opacity: 0.3; margin-bottom: 1rem; display: block; }
.empty-state h4, .empty-state h5 { color: #6b6270; }

/* ==================== QUICK ACTIONS PANEL ==================== */
.border.rounded.p-3.bg-light {
    background: linear-gradient(135deg, #faf7f3, #f3ede8) !important;
    border: 1.5px solid rgba(187,144,89,0.25) !important;
    border-radius: 14px !important;
}
.border.rounded.p-3.bg-light h6 { color: #9A7642 !important; font-size: 0.75rem; }

/* ==================== SCANNER ==================== */
#qr-reader { width: 100%; border-radius: 0; overflow: hidden; }
#qr-scanner-area {
    background: #1a1520;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== RECENT SCANS ==================== */
.recent-scan-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(187,144,89,0.12);
    cursor: pointer;
    transition: background 0.15s ease;
}
.recent-scan-item:hover { background: rgba(187,144,89,0.06); }
.recent-scan-item:last-child { border-bottom: none; }
.recent-scan-time { font-size: 0.72rem; color: #6b6270; }

/* ==================== PRINT ==================== */
@media print {
    .navbar, .btn, .no-print, footer { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6; page-break-inside: avoid; }
    body { background: #fff !important; }
}

/* ==================== MISC UTILITIES ==================== */
.text-muted { color: #6b6270 !important; }
.bg-light { background-color: #faf7f3 !important; }
.border { border-color: rgba(187,144,89,0.25) !important; }

.cursor-pointer { cursor: pointer; }
.fade-in { animation: fadeIn 0.4s ease-in; }
.slide-up { animation: slideUp 0.4s ease-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Accessibility */
:focus-visible { outline: 2px solid #BB9059; outline-offset: 3px; }

/* Mobile-only utility */
@media (max-width: 576px) {
    .hide-xs { display: none !important; }
    .w-100-xs { width: 100% !important; }
}
