/* ── UWA Tour Reservations — Main Stylesheet ──────────────────────────── */

:root {
    --primary:      #1a5c38;   /* UWA forest green */
    --primary-dark: #0f3d25;
    --primary-light:#2e8b57;
    --accent:       #c8960c;   /* golden savanna */
    --accent-light: #f0b429;
    --bg:           #f5f7f2;
    --surface:      #ffffff;
    --border:       #dde3d8;
    --text:         #1a2b1a;
    --text-muted:   #5a7260;
    --danger:       #c0392b;
    --success:      #27ae60;
    --warning:      #e67e22;
    --info:         #2980b9;
    --radius:       8px;
    --shadow:       0 2px 12px rgba(0,0,0,.08);
    --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    position: sticky; top: 0; z-index: 100;
}
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 60px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}
.nav-logo { font-size: 1.4rem; }
.nav-links {
    display: flex;
    gap: .25rem;
    flex: 1;
}
.nav-links a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: .4rem .85rem;
    border-radius: var(--radius);
    font-size: .875rem;
    transition: background .2s, color .2s;
}
.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,.18);
    color: #fff;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}
.user-name { font-size: .875rem; color: rgba(255,255,255,.9); }
.user-badge {
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.role-admin   { background: #c0392b; color: #fff; }
.role-staff   { background: var(--accent); color: #1a1a1a; }
.role-guide   { background: var(--primary-light); color: #fff; }
.role-tourist { background: var(--info); color: #fff; }

.btn-logout {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: .35rem .85rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .8rem;
    transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.28); }

/* ── Flash Messages ─────────────────────────────────────────────────── */
.flash-container { max-width: 1280px; margin: .75rem auto 0; padding: 0 1.5rem; }
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    font-size: .9rem;
}
.alert-success { background: #d4edda; border-left: 4px solid var(--success); color: #155724; }
.alert-error   { background: #f8d7da; border-left: 4px solid var(--danger);  color: #721c24; }
.alert-warning { background: #fff3cd; border-left: 4px solid var(--warning); color: #856404; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.main-content {
    max-width: 1280px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
}
.footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    color: var(--text-muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ── Page Header ────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1 { font-size: 1.6rem; color: var(--primary-dark); }
.page-subtitle   { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; }

/* ── Stats Grid ─────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    border-left: 4px solid var(--primary);
}
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info   { border-left-color: var(--info); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.stat-value.small { font-size: 1.3rem; }
.stat-sub   { font-size: .8rem; color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--primary-dark); }

/* ── Grids ──────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media(max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
    background: var(--bg);
    padding: .65rem 1rem;
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: #f0f4ed; }
tbody td { padding: .75rem 1rem; vertical-align: middle; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: filter .2s, transform .1s;
    white-space: nowrap;
}
.btn:hover { filter: brightness(.92); }
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-accent   { background: var(--accent);  color: #1a1a1a; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-success  { background: var(--success); color: #fff; }
.btn-info     { background: var(--info);    color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1rem; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-success   { background: #d4edda; color: #155724; }
.badge-warning   { background: #fff3cd; color: #856404; }
.badge-danger    { background: #f8d7da; color: #721c24; }
.badge-info      { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e8f0; color: #4a5568; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,92,56,.12);
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; }

/* ── Auth Pages ─────────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .logo-icon { font-size: 3rem; }
.auth-logo h1 { font-size: 1.3rem; color: var(--primary-dark); margin-top: .5rem; }
.auth-logo p  { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Permit / Booking Cards ─────────────────────────────────────────── */
.permit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.permit-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1.5px solid var(--border);
    transition: box-shadow .2s, transform .2s;
}
.permit-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.permit-card-header {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.25rem;
}
.permit-card-header h3 { font-size: 1rem; }
.permit-card-header p  { font-size: .8rem; opacity: .85; margin-top: .2rem; }
.permit-card-body { padding: 1.25rem; }
.permit-slot-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: .5rem 0;
}
.permit-slot-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 4px;
    transition: width .4s;
}
.permit-slot-fill.low    { background: var(--danger); }
.permit-slot-fill.medium { background: var(--warning); }

/* ── Booking Detail ─────────────────────────────────────────────────── */
.booking-ref {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    background: #e8f5e9;
    padding: .35rem .75rem;
    border-radius: var(--radius);
    letter-spacing: .05em;
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.detail-item label { font-size: .75rem; text-transform: uppercase; color: var(--text-muted); }
.detail-item span  { display: block; font-weight: 600; margin-top: .2rem; }

/* ── Chart containers ───────────────────────────────────────────────── */
.chart-container { position: relative; height: 260px; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: .4rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
}
.pagination a, .pagination span {
    padding: .4rem .75rem;
    border-radius: var(--radius);
    font-size: .85rem;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--primary);
    transition: background .2s;
}
.pagination a:hover  { background: var(--primary); color: #fff; }
.pagination .active  { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled{ color: var(--text-muted); pointer-events: none; }

/* ── Filter Bar ─────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ── Misc ───────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem;  }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem;  }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: .75rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
