/* EventReg - Professional Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary: #0f4c81;
    --primary-dark: #0a3460;
    --primary-light: #e8f0f8;
    --accent: #e8833a;
    --accent-dark: #d06f2a;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #dfe6e9;
    --border-light: #eef1f3;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --sidebar-width: 260px;
    --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ─── Layout ─────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section {
    padding: 8px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-item.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-left-color: var(--accent);
}

.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
}

.sidebar-footer .user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.content-area { padding: 32px; flex: 1; }

/* ─── Cards ──────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 24px; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.3px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,129,0.1);
}

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

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

select.form-control { appearance: auto; }

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-check label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    line-height: 1.5;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child { border-bottom: none; }

.form-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── Color input ────────────────────────────────── */
input[type="color"] {
    width: 50px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-group .color-label { font-size: 13px; color: var(--text-light); }

/* ─── Tables ─────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr:hover { background: rgba(15,76,129,0.02); }

/* ─── Badges ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: #fef0e3; color: var(--accent); }
.stat-icon.green { background: #e8f8ef; color: var(--success); }
.stat-icon.red { background: #fde8e8; color: var(--danger); }

.stat-info h4 { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-info p { font-size: 13px; color: var(--text-light); font-weight: 500; }

/* ─── Alerts ─────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: #cce5ff; color: #004085; border-left: 4px solid var(--info); }

/* ─── Tabs ───────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Empty State ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h4 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ─── Registration Link Box ─────────────────────── */
.link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.link-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 13px;
    color: var(--text);
    outline: none;
}

/* ─── Login Page ─────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1a6db5 50%, var(--accent) 100%);
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 56px; height: 56px;
    background: var(--primary);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.auth-logo p { color: var(--text-light); font-size: 14px; }

/* ─── Public Registration Form ───────────────────── */
.public-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.public-card {
    width: 100%;
    max-width: 680px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.public-header {
    padding: 40px;
    text-align: center;
}

.public-header img { max-height: 80px; margin-bottom: 16px; }
.public-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.public-header .event-meta { font-size: 14px; opacity: 0.85; margin-top: 12px; }
.public-header .event-meta span { margin: 0 8px; }

.public-body { padding: 32px 40px; }
.public-footer { padding: 20px 40px; text-align: center; font-size: 13px; color: var(--text-light); border-top: 1px solid var(--border-light); }

/* ─── Success Page ───────────────────────────────── */
.success-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.success-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    text-align: center;
    padding: 48px 40px;
}

.success-icon {
    width: 80px; height: 80px;
    background: #e8f8ef;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
}

.success-card h1 { font-size: 24px; color: var(--success); margin-bottom: 12px; }
.success-card p { color: var(--text-light); font-size: 15px; margin-bottom: 24px; }

.qr-display {
    display: inline-block;
    padding: 20px;
    background: #fff;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.qr-display img { display: block; }

/* ─── Form builder table ─────────────────────────── */
.fields-table {
    width: 100%;
    border-collapse: collapse;
}

.fields-table th {
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
    text-align: center;
    background: var(--bg);
}

.fields-table th:first-child { text-align: left; }

.fields-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    font-size: 14px;
}

.fields-table td:first-child { text-align: left; font-weight: 500; }

/* ─── GDPR consent box ──────────────────────────── */
.gdpr-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-light);
}

/* ─── Lang Switch ────────────────────────────────── */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

.lang-switch a {
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 10px;
}

.lang-switch a.active {
    color: var(--primary);
    background: var(--surface);
}

/* ─── Pagination ─────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    border: 1px solid var(--border);
}

.pagination a:hover { background: var(--primary-light); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: block; }
    .topbar { padding: 12px 16px; }
    .content-area { padding: 16px; }
    .auth-card { padding: 32px 24px; }
    .public-body { padding: 24px 20px; }
    .public-header { padding: 30px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ─── Overlay for mobile sidebar ─────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ─── Utilities ──────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-small { font-size: 13px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
