@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* ==========================================================================
   Design System & Theme Variables
   ========================================================================== */
:root {
    /* Fonts */
    --font-primary: 'Prompt', sans-serif;
    --font-heading: 'Kanit', sans-serif;

    /* Light Theme (Default) */
    --primary: #0d9488;      /* Deep Teal */
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --secondary: #0ea5e9;    /* Sky Blue */
    --accent: #10b981;       /* Emerald */
    --accent-hover: #059669;
    --danger: #ef4444;       /* Crimson */
    --danger-hover: #dc2626;
    --warning: #f59e0b;      /* Amber */
    --info: #3b82f6;
    
    --bg-app: #f4f6f9;
    --bg-card: #ffffff;
    --bg-navbar: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s ease;
    
    --backdrop-blur: blur(8px);
}

/* Dark Theme overrides */
[data-theme="dark"] {
    --bg-app: #0f172a;       /* Slate 900 */
    --bg-card: #1e293b;      /* Slate 800 */
    --bg-navbar: #1e293b;
    --bg-input: #0f172a;
    --text-primary: #f8fafc;  /* Slate 50 */
    --text-secondary: #cbd5e1;/* Slate 300 */
    --text-muted: #64748b;    /* Slate 500 */
    --border-color: #334155;  /* Slate 700 */
    --primary-light: #115e59;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

/* ==========================================================================
   Base CSS Resets & Setup
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    scroll-behavior: smooth;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==========================================================================
   Global Layout Components
   ========================================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-app);
}

/* Header & Navbar */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.nav-brand img {
    height: 40px;
    width: 40px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--primary);
}

.nav-brand span {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 1px solid var(--border-color);
    padding-left: 1.5rem;
}

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-badge .user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.view-container {
    animation: fadeIn var(--transition-normal);
    width: 100%;
}

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

/* Footer */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-navbar);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Utility Helpers */
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-top: 1rem; }
.w-full { width: 100%; }

.text-danger { color: var(--danger); }
.text-success { color: var(--accent); }
.text-warning { color: var(--warning); }
