/**
 * ============================================
 * STYLES.CSS - Dashboard P3H Doa Bangsa
 * ============================================
 * Stylesheet utama untuk dashboard dengan desain modern,
 * glassmorphism effects, dan fully responsive.
 * 
 * @version 2.0.0
 * @author LP3H Doa Bangsa
 * 
 * TABLE OF CONTENTS:
 * 1. CSS Custom Properties (Variables)
 * 2. Base & Reset Styles
 * 3. Typography
 * 4. Layout Components
 * 5. Loading Screen
 * 6. Login Container
 * 7. Sidebar Navigation
 * 8. Header
 * 9. Cards & Panels
 * 10. Tables
 * 11. Forms & Inputs
 * 12. Chat UI
 * 13. Animations & Transitions
 * 14. Scrollbar Customization
 * 15. Utility Classes
 * 16. Responsive Breakpoints
 */

/* ==========================================
   1. CSS CUSTOM PROPERTIES (VARIABLES)
   ========================================== */
:root {
    /* Brand Colors - Emerald Green Palette */
    --brand-50: #ecfdf5;
    --brand-100: #d1fae5;
    --brand-200: #a7f3d0;
    --brand-300: #6ee7b7;
    --brand-400: #34d399;
    --brand-500: #10b981;
    --brand-600: #059669;
    --brand-700: #047857;
    --brand-800: #065f46;
    --brand-900: #064e3b;

    /* Slate Colors */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Semantic Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Background & Surface */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.9);

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border-light: #e2e8f0;
    --border-focus: #10b981;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-soft: 0 4px 20px -2px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Font Families */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-loading: 9999;
}

/* ==========================================
   2. BASE & RESET STYLES
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    antialiased;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selection Style */
::selection {
    background-color: var(--brand-200);
    color: var(--brand-900);
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ==========================================
   3. TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.text-brand { color: var(--brand-500); }
.text-muted { color: var(--text-muted); }

.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

/* ==========================================
   4. LAYOUT COMPONENTS
   ========================================== */

/* Main Dashboard Container */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-primary);
}

/* Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    scroll-behavior: smooth;
}

@media (min-width: 1024px) {
    .content-scrollable {
        padding: var(--spacing-xl) 2rem;
    }
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeInUp 0.5s ease-out forwards;
}

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

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.breadcrumb .separator {
    margin: 0 var(--spacing-xs);
}

.breadcrumb .current {
    color: var(--brand-600);
    font-weight: 500;
}

/* ==========================================
   5. LOADING SCREEN
   ========================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-600) 100%);
    z-index: var(--z-loading);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.loading-screen.slide-up {
    transform: translateY(-100%);
}

.loader-ring {
    display: inline-block;
    width: 64px;
    height: 64px;
}

.loader-ring::after {
    content: " ";
    display: block;
    width: 46px;
    height: 46px;
    margin: 8px;
    border-radius: 50%;
    border: 5px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   6. LOGIN CONTAINER
   ========================================== */
.login-container {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: row;
    background: white;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Login Branding Side */
.login-branding {
    display: none;
    width: 33.333%;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .login-branding {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .login-branding {
        width: 25%;
    }
}

.login-branding-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, var(--brand-900), var(--brand-700));
}

.login-branding-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 20px 20px;
}

.login-branding-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    height: 100%;
    color: white;
}

/* Login Form Side */
.login-form-side {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
    background: var(--bg-primary);
    overflow-y: auto;
}

@media (min-width: 768px) {
    .login-form-side {
        width: 66.667%;
    }
}

@media (min-width: 1024px) {
    .login-form-side {
        width: 75%;
        padding: 3rem;
    }
}

.login-decor-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    display: none;
}

@media (min-width: 1024px) {
    .login-decor-image {
        display: block;
    }
}

.login-form-wrapper {
    width: 100%;
    max-width: 28rem;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.5s ease-out forwards;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 2rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
}

/* ==========================================
   7. SIDEBAR NAVIGATION
   ========================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: var(--z-overlay);
    backdrop-filter: blur(4px);
    transition: opacity var(--transition-normal);
    opacity: 0;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar {
    position: fixed;
    inset-y: 0;
    left: 0;
    z-index: calc(var(--z-overlay) + 1);
    width: 18rem;
    background: var(--bg-sidebar);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar.open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .sidebar {
        position: static;
        transform: translateX(0);
        box-shadow: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    background: linear-gradient(to bottom right, var(--brand-900), var(--brand-800));
    color: white;
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8rem;
    height: 8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: -2.5rem;
    margin-top: -2.5rem;
    filter: blur(1rem);
}

.sidebar-user-info {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1.25rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-label {
    padding: 0.5rem 1rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-600);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.nav-button:hover {
    background: white;
    color: var(--brand-600);
    box-shadow: var(--shadow-sm);
}

.nav-button.active {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
}

.nav-button i {
    font-size: 1.125rem;
    transition: transform var(--transition-fast);
}

.nav-button:hover i {
    transform: scale(1.1);
}

/* Admin-specific nav buttons */
.nav-button.admin-rekap {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.nav-button.admin-rekap:hover {
    background: #fee2e2;
}

.nav-button.admin-klasemen {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.nav-button.admin-klasemen:hover {
    background: #d1fae5;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(241, 245, 249, 0.8);
}

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-button:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.logout-button i {
    transition: transform var(--transition-fast);
}

.logout-button:hover i {
    transform: translateX(-0.25rem);
}

/* ==========================================
   8. HEADER
   ========================================== */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
}

@media (min-width: 1024px) {
    .header {
        padding: 1rem 2rem;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: flex;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--slate-600);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--slate-100);
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--slate-800);
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 640px) {
    .header-subtitle {
        display: block;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-info {
    text-align: right;
    display: none;
}

@media (min-width: 640px) {
    .header-user-info {
        display: block;
    }
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-700);
    line-height: 1.4;
}

.header-user-id {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--brand-600);
    background: var(--brand-50);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 0.125rem;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(to top right, var(--brand-500), var(--brand-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    border: 2px solid white;
}

/* ==========================================
   9. CARDS & PANELS
   ========================================== */
.card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(248, 250, 252, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    transition: transform var(--transition-fast);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--slate-800);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   10. TABLES
   ========================================== */
.table-container {
    overflow-x: auto;
    max-height: 37.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.custom-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.custom-table th {
    background-color: var(--slate-50);
    color: var(--slate-600);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-light);
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--slate-700);
}

.custom-table tbody tr {
    transition: all var(--transition-fast);
}

.custom-table tbody tr:hover {
    background-color: var(--brand-50);
    transform: scale(1.005);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   11. FORMS & INPUTS
   ========================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    inset-y: 0;
    left: 0;
    padding-left: 0.75rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.input-wrapper:focus-within .input-icon {
    color: var(--brand-500);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    background: var(--slate-50);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-input:hover {
    background: white;
}

.form-input:focus {
    outline: none;
    ring: 2px solid var(--brand-500);
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--brand-600);
}

/* Checkbox Custom */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

.checkbox-custom {
    width: 1rem;
    height: 1rem;
    appearance: none;
    border: 1px solid var(--slate-300);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-custom:checked {
    border-color: var(--brand-500);
    background: var(--brand-500);
}

.checkbox-custom:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 0.25rem;
    height: 0.375rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(to right, var(--brand-600), var(--brand-500));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--brand-700), var(--brand-600));
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--slate-200);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Select Dropdown */
.form-select {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-select:focus {
    outline: none;
    ring: 2px solid var(--brand-500);
    border-color: var(--brand-500);
}

/* Error Message */
.error-message {
    color: #dc2626;
    text-align: center;
    font-size: 0.875rem;
    background: #fef2f2;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid #fecaca;
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out forwards;
}

.error-message.hidden {
    display: none;
}

/* ==========================================
   12. CHAT UI
   ========================================== */
.chat-container {
    height: 25rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    position: relative;
    line-height: 1.5;
    font-size: 0.875rem;
    animation: fadeInUp 0.3s ease-out forwards;
    word-wrap: break-word;
}

.chat-bubble.ai {
    background-color: var(--slate-100);
    color: var(--slate-700);
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
}

.chat-bubble.user {
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
    align-self: flex-end;
}

.typing-indicator {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--slate-500);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-light);
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    resize: none;
}

.chat-input:focus {
    outline: none;
    border-color: var(--brand-500);
}

.chat-send-btn {
    padding: 0.75rem 1.25rem;
    background: var(--brand-500);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--brand-600);
}

/* ==========================================
   13. ANIMATIONS & TRANSITIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Staggered Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ==========================================
   14. SCROLLBAR CUSTOMIZATION
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: 1rem;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 1rem;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-500);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) var(--slate-100);
}

/* ==========================================
   15. UTILITY CLASSES
   ========================================== */
.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Glass Effect Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(226, 232, 240, 0.8);
}

/* Brand Color Utilities */
.bg-brand-50 { background-color: var(--brand-50); }
.bg-brand-100 { background-color: var(--brand-100); }
.bg-brand-500 { background-color: var(--brand-500); }
.bg-brand-600 { background-color: var(--brand-600); }
.bg-brand-700 { background-color: var(--brand-700); }
.bg-brand-900 { background-color: var(--brand-900); }

.text-brand-500 { color: var(--brand-500); }
.text-brand-600 { color: var(--brand-600); }
.text-brand-700 { color: var(--brand-700); }
.text-brand-900 { color: var(--brand-900); }

.border-brand-100 { border-color: var(--brand-100); }
.border-brand-500 { border-color: var(--brand-500); }

/* Slate Color Utilities */
.bg-slate-50 { background-color: var(--slate-50); }
.bg-slate-100 { background-color: var(--slate-100); }
.bg-slate-800 { background-color: var(--slate-800); }
.bg-slate-900 { background-color: var(--slate-900); }

.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-700 { color: var(--slate-700); }
.text-slate-800 { color: var(--slate-800); }

/* ==========================================
   16. RESPONSIVE BREAKPOINTS
   ========================================== */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .sm\:block { display: block; }
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row; }
    .md\:flex-col { flex-direction: column; }
    .md\:w-auto { width: auto; }
    .md\:w-2\/3 { width: 66.667%; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:w-3\/4 { width: 75%; }
    .lg\:w-1\/4 { width: 25%; }
    .lg\:static { position: static; }
    .lg\:shadow-none { box-shadow: none; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
    .xl\:text-left { text-align: left; }
}
