/* ==========================================================
   APHEOG Conference Management System - Core Stylesheet
   Modern, responsive, fast-loading design
   ========================================================== */

:root {
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-dark: #1e3a8a;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* ---------------- Layout & Containers ---------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 760px;
}

/* ---------------- Public Header & Hero ---------------- */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 50px 0 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gray-50);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.conf-acronym-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-tagline {
    font-size: 17px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 20px auto;
    font-weight: 400;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 14px;
    border-radius: 9999px;
}

/* ---------------- Cards & Panels ---------------- */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    padding: 32px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ---------------- Form Controls ---------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-group.col-span-2 {
        grid-column: span 1;
    }
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--danger);
}

.form-control, .form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--gray-900);
    background-color: white;
    transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-align: center;
}

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

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

.btn-secondary {
    background: white;
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: white !important;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger);
    color: white !important;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 15px 30px;
    font-size: 17px;
    font-weight: 700;
}

.btn-block {
    width: 100%;
}

/* ---------------- Alerts & Notices ---------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success-light);
    color: #14532d;
    border: 1px solid #86efac;
}

.alert-danger {
    background: var(--danger-light);
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: var(--warning-light);
    color: #78350f;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--primary-light);
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

/* ---------------- Badges & Pills ---------------- */
.badge-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

/* ---------------- Digital Ticket Presentation ---------------- */
.ticket-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    max-width: 650px;
    margin: -30px auto 40px auto;
    position: relative;
    z-index: 10;
}

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

.ticket-body {
    padding: 32px;
}

.ticket-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
}

.ticket-code-display {
    font-family: monospace;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary);
    margin-top: 10px;
}

/* ---------------- Kiosk Screen ---------------- */
.kiosk-body {
    background-color: #090d16;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.kiosk-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kiosk-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kiosk-scanner-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 28px;
    max-width: 540px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.scanner-viewfinder {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 320px;
    margin: 0 auto 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

#kiosk-reader {
    width: 100% !important;
    height: 100% !important;
}

#kiosk-reader video {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 14px;
}

.scanner-overlay {
    position: absolute;
    inset: 20px;
    border: 2px dashed #60a5fa;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    animation: pulseBorder 2s infinite ease-in-out;
}

@keyframes pulseBorder {
    0%, 100% { border-color: #3b82f6; }
    50% { border-color: #60a5fa; }
}

/* Kiosk Welcome Modal */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.welcome-card {
    background: white;
    color: var(--gray-900);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.welcome-icon {
    width: 72px;
    height: 72px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 16px auto;
}

.countdown-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 9999px;
    margin-top: 20px;
    overflow: hidden;
}

.countdown-progress {
    height: 100%;
    background: var(--primary);
    width: 100%;
    transition: width 1s linear;
}

/* ---------------- Admin Dashboard ---------------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-brand {
    padding: 0 24px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-brand h2 {
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}

.admin-brand p {
    font-size: 12px;
    color: var(--gray-400);
}

.admin-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.admin-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.admin-menu-item a:hover, .admin-menu-item.active a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-menu-item.active a {
    background: var(--primary);
}

.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    overflow-x: hidden;
}

.admin-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-main {
    padding: 32px;
    flex: 1;
}

/* Admin KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 6px 0;
}

.kpi-subtitle {
    font-size: 12px;
    color: var(--gray-500);
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.data-table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}
