/* ===============================================
   BASE.CSS - Wholesale Platform Design System
   Extracted from Hotel Operator App
   =============================================== */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Enhanced Root Variables - Professional Color Palette */
:root {
    /* Background Colors - Harmonious monochromatic beige */
    --bg-primary: #ebe9e6;
    --bg-workspace: #f5f4f2;
    --bg-secondary: #fafaf9;
    --bg-white: #ffffff;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #2d2d2d;
    --text-tertiary: #404040;
    --text-body: #525252;
    --text-muted: #737373;
    --text-light: #8a8a8a;
    
    /* Font Weights - High Density Hierarchy */
    --font-weight-normal: 400;    /* Body text, descriptions, data */
    --font-weight-medium: 500;    /* Labels, navigation, subtle emphasis */
    --font-weight-semibold: 600;  /* Headings, active states, key metrics */
    
    /* Border Colors */
    --border-light: #e8e7e5;
    --border-medium: #d4d3d0;
    --border-focus: #22c55e;
    
    /* Input Field Colors (Claude-Inspired) */
    --input-border: #d4d3d0;
    --input-border-hover: #c4c3c0;
    --input-border-focus: #22c55e;
    --input-bg: #ffffff;
    --input-bg-disabled: #fafaf9;
    --input-placeholder: #9ca3af;
    
    /* Action Colors */
    --color-primary: #16a34a;
    --color-primary-hover: #15803d;
    --color-secondary: #f59e0b;
    --color-secondary-hover: #d97706;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #dc2626;
    --color-info: #3b82f6;
    
    /* Status Colors */
    --status-confirmed: #16a34a;
    --status-pending: #d97706;
    --status-running: #3b82f6;
    --status-active: #16a34a;
    --status-draft: #6b7280;
    --status-sent: #3b82f6;
    
    /* Churn Risk Colors */
    --churn-critical: #dc2626;
    --churn-high: #f59e0b;
    --churn-medium: #3b82f6;
    --churn-low: #22c55e;
    
    /* Sidebar Variables */
    --sidebar-width-expanded: 240px;
    --sidebar-width-collapsed: 44px;
    --sidebar-transition: all 300ms cubic-bezier(0.25, 0.8, 0.25, 1);
    --sidebar-gap: 24px;
    
    /* Animation timing */
    --coordinated-duration: 300ms;
    --coordinated-easing: cubic-bezier(0.25, 0.8, 0.25, 1);
    --coordinated-exit-easing: cubic-bezier(0.4, 0, 1, 1);
    
    /* Header heights */
    --header-height: 56px;
    
    /* Professional Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing Scale - Compact for Data Density */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;       /* ⚡ Reduced from 16px for tighter layouts */
    --space-lg: 16px;       /* ⚡ Reduced from 24px */
    --space-xl: 24px;       /* ⚡ Reduced from 32px */
    --space-2xl: 32px;      /* ⚡ Reduced from 48px */
    
    /* Semantic Spacing */
    --space-comfortable: 16px;  /* ⚡ Reduced from 20px */
    --space-section: 28px;      /* ⚡ Reduced from 40px */
    
    /* Typography Scale - Compact for Data Density */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 13px;      /* ⚡ Reduced from 14px for compact feel */
    --text-lg: 15px;        /* ⚡ Reduced from 16px */
    --text-xl: 18px;        /* ⚡ Reduced from 20px */
    --text-2xl: 22px;       /* ⚡ Reduced from 24px */
    --text-3xl: 26px;       /* ⚡ Reduced from 28px - use sparingly */
    
    /* Line Heights (Claude-Inspired) */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    
    /* Code Blocks (For Future) */
    --code-bg: #f5f5f5;
    --code-radius: 6px;
    --code-padding: 16px;
    --code-color: var(--text-primary);
    --code-inline-bg: #f5f5f5;
    --code-inline-color: #d97706;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    
    /* Input-Specific Radius (Claude-Inspired) */
    --radius-input: 10px;
    
    /* Professional Animation Timing */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--text-body);
    background-color: var(--bg-primary);
    font-weight: var(--font-weight-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1 {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: var(--line-height-tight);
}

h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    line-height: var(--line-height-tight);
}

h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
    line-height: var(--line-height-tight);
}

p {
    line-height: var(--line-height-normal);
}

/* App Layout */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: calc(100vh - 60px - var(--sidebar-gap));
    position: relative;
}

/* Sidebar - Core Layout (positioned alongside main-content) */
.sidebar {
    width: var(--sidebar-width-expanded);
    align-self: stretch;            /* ✅ Stretch to fill container height */
    margin: 0 0 24px 0;             /* ✅ Same bottom margin as main-content */
    flex-shrink: 0;                 /* Don't shrink */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar[data-state="collapsed"] {
    width: var(--sidebar-width-collapsed);
}

/* Main Content - Single source of truth for content area styling */
.main-content {
    flex: 1;
    min-height: 0;
    margin: 0 24px 24px 24px;       /* 24px bottom margin */
    padding: var(--space-lg);       /* 16px padding - breathing room for sections (dashboard) */
    overflow-y: auto;
    background: var(--bg-workspace); /* Beige - consistent background for all sections */
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    transition: margin-left var(--coordinated-duration) var(--coordinated-easing);
}

/* When tabs are present - tabs need full width and handle their own scrolling */
.main-content:has(.tabbed-container) {
    padding: 0;
    overflow: hidden;  /* Tabs handle scrolling internally */
}

/* Main content gets module-content styling */
#main-content,
.module-content {
    width: 100%;
    height: 100%;               /* ✅ Fills parent for proper scrolling */
    min-height: 100%;           /* ✅ Background fills entire space even with short content */
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-workspace);
    border-radius: var(--radius-2xl);
    padding: 0;
    box-sizing: border-box;
}

/* Enhanced Focus Ring */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Loading States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
}

.loading-spinner {
    font-size: 32px;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    min-height: 200px;
}

.empty-state h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-primary {
    color: var(--text-primary);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Font Weight Utilities */
.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

