﻿/* ══════════════════════════════════════════════════════════════════
   BASE — Reset, Variables, Typography, App Shell
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Variables ───────────────────────────────────────────────────── */
:root {
    --navy: #1A3263;
    --navy-dark: #122349;
    --navy-light: #1e3d7a;
    --steel: #547792;
    --steel-light: #6a8fa8;
    --gold: #FAB95B;
    --gold-dark: #e8a444;
    --cream: #E8E2DB;
    --cream-dark: #d9d2c9;
    --white: #ffffff;
    --text: #1A3263;
    --text-dark: #0f1f3d;
    --text-muted: #547792;
    --border: #d4cdc5;
    --shadow: 0 2px 12px rgba(26,50,99,0.10);
    --shadow-card: 0 2px 8px rgba(26,50,99,0.08);
    --radius: 10px;
    --radius-sm: 6px;
    --nav-height: 64px;
    --transition: 0.2s ease;
}

/* ── Base ────────────────────────────────────────────────────────── */
html, body {
    font-family: 'Segoe UI', 'Noto Sans Thai', sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── App Shell ───────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.main-content {
    flex: 1;
}

/* ── Utilities ───────────────────────────────────────────────────── */
.d-flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-content-start {
    justify-content: flex-start;
}

.flex-wrap {
    flex-wrap: wrap;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.text-danger {
    color: #dc2626;
}

.text-success {
    color: #16a34a;
}

.text-warning {
    color: #d97706;
}

.text-muted {
    color: var(--text-muted);
}

.ms-auto {
    margin-left: auto;
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scroll-left {
    0% {
        transform: translateX(75%);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── App Loading ─────────────────────────────────────────────────── */
.app-loading {
    position: fixed;
    inset: 0;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: white;
}

.app-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.app-loading-text {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.app-loading-subtext {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.app-loading-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ── Error UI ────────────────────────────────────────────────────── */
#blazor-error-ui {
    display: none;
}

/* ── Loading & Empty States ──────────────────────────────────────── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-border-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.spinner-border {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.see-all {
    text-align: center;
    margin-top: 1.5rem;
}
