/* ===== Design Tokens ===== */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: #0891b2;
    --info-light: #ecfeff;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

/* ===== Domain Watermark ===== */
.domain-watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}
.domain-watermark a {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    color: rgba(0, 0, 0, 0.15);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    transform: rotate(-30deg);
    pointer-events: auto;
    user-select: none;
    transition: color .2s;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.domain-watermark a:hover {
    color: rgba(79, 70, 229, 0.35);
}

/* ===== Base ===== */
html {
    font-size: 15px;
    min-height: 100%;
    position: relative;
}
@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    margin-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main, .main-wrap { flex: 1; }

/* ===== Focus ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .25);
    border-color: var(--primary);
}

/* ===== Navbar ===== */
.site-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: .6rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.92);
}
.site-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.site-navbar .navbar-brand i {
    font-size: 1.4rem;
}
.site-navbar .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: .9rem;
    padding: .45rem .85rem;
    border-radius: var(--radius-sm);
    transition: color .15s, background .15s;
}
.site-navbar .nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .5rem 1.25rem;
    font-size: .9rem;
    transition: all .15s ease;
    letter-spacing: -.005em;
}
.btn-lg {
    padding: .65rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius);
}
.btn-sm {
    padding: .3rem .75rem;
    font-size: .8rem;
    border-radius: var(--radius-xs);
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface);
    overflow: hidden;
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.card-body { padding: 1.25rem; }

/* ===== Hero ===== */
.hero-section {
    background: var(--primary-gradient);
    min-height: 55vh;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section > * { position: relative; z-index: 1; }
.hero-section .card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}
.hero-section h1 {
    letter-spacing: -.03em;
}
.hero-section .lead {
    opacity: .85;
    font-weight: 400;
}

/* ===== Feature Icons ===== */
.feature-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
    background: var(--primary-light);
    color: var(--primary);
    transition: transform .2s;
}
.feature-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: box-shadow .2s, transform .2s;
    text-align: center;
}
.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== Badges ===== */
.badge {
    font-weight: 600;
    font-size: .75rem;
    padding: .35em .75em;
    border-radius: 99px;
    letter-spacing: .01em;
}
.badge-soft-success { background: var(--success-light); color: var(--success); }
.badge-soft-warning { background: var(--warning-light); color: var(--warning); }
.badge-soft-danger  { background: var(--danger-light); color: var(--danger); }
.badge-soft-info    { background: var(--info-light); color: var(--info); }
.badge-soft-primary { background: var(--primary-light); color: var(--primary); }
.badge-soft-secondary { background: #f1f5f9; color: var(--text-secondary); }

/* ===== Stat Cards ===== */
.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}
.stat-card .stat-label {
    font-size: .85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Tables ===== */
.table {
    font-size: .875rem;
}
.table thead th {
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    padding: .85rem 1rem;
    background: #f8fafc;
}
.table tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* ===== Booking Cards ===== */
.booking-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
}
.booking-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ===== Car Park Result Cards ===== */
.carpark-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
    position: relative;
    overflow: hidden;
}
.carpark-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
}
.carpark-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* ===== Sidebar ===== */
@media (min-width: 768px) {
    .booking-sidebar {
        position: sticky;
        top: 90px;
    }
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: .55rem .85rem;
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control-lg, .form-select-lg {
    border-radius: var(--radius);
    padding: .65rem 1rem;
    font-size: .95rem;
}
.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
    margin-bottom: .35rem;
}

/* ===== Price Display ===== */
.price-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: -.01em;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.02em;
}

/* ===== Breadcrumbs ===== */
.breadcrumb {
    font-size: .85rem;
    margin-bottom: 1.25rem;
    padding: 0;
    background: none;
}
.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ===== Empty State ===== */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}
.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: .85rem;
}
.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--primary);
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--radius);
    border: none;
    font-size: .9rem;
}
.alert-success {
    background: var(--success-light);
    color: #065f46;
}
.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

/* ===== Confirmation Page ===== */
.confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}
.confirmation-icon.success {
    background: var(--success-light);
    color: var(--success);
}
.confirmation-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ===== Auth Pages ===== */
.auth-card {
    max-width: 480px;
    margin: 2rem auto;
}

/* ===== Misc ===== */
.text-primary { color: var(--primary) !important; }
a { color: var(--primary); }

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-switch .form-check-input {
    border-radius: 99px;
}

/* Dropdown */
.dropdown-menu {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: .5rem;
    font-size: .9rem;
}
.dropdown-item {
    border-radius: var(--radius-xs);
    padding: .45rem .75rem;
}
.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Input group */
.input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #f8fafc;
    font-size: .9rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
