/* 
 * 📊 PROFESSIONAL ACCOUNTING LIGHT THEME
 * =====================================
 * 
 * Modern, clean, light theme designed for professional accounting software
 * with excellent readability and accessibility.
 * 
 * Font Stack:
 * - Primary: Inter (UI text, buttons, labels)
 * - Secondary: Source Sans Pro (body text, longer content)
 * - Monospace: JetBrains Mono (numbers, codes, data)
 * 
 * @author FinQup Design System
 * @version 2.0.0
 */

/* ========================================
   ROOT VARIABLES - LIGHT THEME PALETTE
   ======================================== */

:root {
  /* === CORE COLORS === */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-accent: #e2e8f0;
  
  /* === TEXT COLORS === */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* === BORDER COLORS === */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;
  
  /* === BRAND COLORS === */
  /* Brand Green: #0D4D3B (Primary brand color) */
  /* Brand Blue: #121e60 (Secondary brand color) */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  
  --brand-green: #0D4D3B;
  --brand-blue: #121e60;
  
  --success: #0D4D3B;
  --success-dark: #059669;
  --success-light: #d1fae5;
  
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fef3c7;
  
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #fee2e2;
  
  /* === ACCOUNTING SPECIFIC === */
  --debit-color: #059669;
  --credit-color: #dc2626;
  --balance-color: #3b82f6;
  --konto-color: #8b5cf6;
  
  /* === TYPOGRAPHY === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-secondary: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
  
  /* === SHADOWS === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  
  /* === SPACING === */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* === BORDER RADIUS === */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ========================================
   GLOBAL OVERRIDES
   ======================================== */

/* Force light theme */
html.light,
html.light body,
.light {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* Typography base */
body {
  font-family: var(--font-primary) !important;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.text-white span , 
.text-white svg ,
button.text-white ,
a.text-white ,
  .text-white {
    color: #ffffff !important;
}


/* ========================================
   TAILWIND OVERRIDES FOR LIGHT THEME
   ======================================== */

/* Background overrides */
.bg-gray-900 { background-color: var(--bg-primary) !important; }
.bg-gray-800 { background-color: var(--bg-secondary) !important; }
.bg-gray-700 { background-color: var(--bg-tertiary) !important; }
.bg-gray-600 { background-color: #4b5563 !important; color: #000000 !important; }

/* Text color overrides */
.text-white { color: #ffffff !important; }
.text-gray-200 { color: var(--text-primary) !important; }
.text-gray-300 { color: var(--text-secondary) !important; }
.text-gray-400 { color: var(--text-tertiary) !important; }
.text-gray-500 { color: var(--text-tertiary) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-700 { color: var(--text-primary) !important; }
.text-gray-800 { color: var(--text-primary) !important; }

/* Dashboard specific text colors */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
  font-family: var(--font-primary) !important;
}

/* Enhanced dashboard elements */
.enhanced-kpi-card h3,
.enhanced-kpi-card p,
.chart-container h3,
.chart-container p {
  color: var(--text-primary) !important;
}

/* Junior dashboard headers */
.junior-dashboard h2,
.junior-dashboard h3,
.junior-dashboard h4 {
  color: var(--text-primary) !important;
}

/* Border overrides */
.border-gray-700 { border-color: var(--border-light) !important; }
.border-gray-600 { border-color: var(--border-medium) !important; }
.border-gray-500 { border-color: var(--border-strong) !important; }

/* Hover states */
.hover\\:bg-gray-700:hover { background-color: #374151 !important; color: #000000 !important; }
.hover\\:bg-gray-600:hover { background-color: var(--bg-accent) !important; }
.hover\\:text-white:hover { color: var(--text-primary) !important; }

/* Orange background colors */
.bg-orange-600 { background-color: #ea580c !important; color: #ffffff !important; }
.hover\\:bg-orange-700:hover { background-color: #c2410c !important; }

/* ========================================
   LAYOUT IMPROVEMENTS
   ======================================== */

/* Full-width layout improvements */
.w-full {
  width: 100% !important;
}

/* Remove container constraints for better space usage */
.container {
  max-width: none !important;
  width: 100% !important;
}

/* Dashboard specific improvements */
#dashboard-stats {
  padding: 1.5rem !important;
}

/* Better spacing for cards */
.grid {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Responsive padding */
@media (min-width: 768px) {
  #dashboard-stats {
    padding: 2rem !important;
  }
}

@media (min-width: 1200px) {
  #dashboard-stats {
    padding: 2.5rem !important;
  }
}

/* ========================================
   COMPONENT SPECIFIC STYLES
   ======================================== */

/* === SIDEBAR === */
.sidebar {
  background-color: var(--bg-secondary) !important;
  border-right: 1px solid var(--border-light) !important;
}

.nav-item {
  color: var(--text-secondary) !important;
  font-family: var(--font-primary) !important;
  font-weight: 500 !important;
}

/* Override for active nav items - use light green background */
.nav-item.active,
.nav-item.nav-item-active {
  background: linear-gradient(to right, #38b57c, #2c8268) !important; /* light green */
  color: #ffffff !important;
}

.nav-item.active .sidebar-text,
.nav-item.nav-item-active .sidebar-text {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.nav-item.active i,
.nav-item.nav-item-active i {
  color: #ffffff !important;
}

.nav-item:hover:not(.active):not(.nav-item-active) {
  background-color: #e5e7eb !important;
}

/* === HEADERS === */
.header,
.panel-header {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-light) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
}

/* === CARDS === */
.card,
.bg-gray-800 {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* === BUTTONS === */
.btn-primary,
.button-primary {
  background-color: var(--primary) !important;
  color: var(--text-inverse) !important;
  border: none !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.btn-primary:hover,
.button-primary:hover {
  background-color: var(--primary-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
}

.btn-secondary,
.button-secondary {
  background-color: var(--bg-primary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-medium) !important;
  font-family: var(--font-primary) !important;
  font-weight: 500 !important;
}

.btn-secondary:hover,
.button-secondary:hover {
  background-color: var(--bg-tertiary) !important;
  border-color: var(--border-strong) !important;
}

/* === FORMS === */
input, textarea, select {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-medium) !important;
  font-family: var(--font-secondary) !important;
  border-radius: var(--radius-md) !important;
}

input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-light) !important;
}

/* === UPLOAD ZONES === */
.upload-zone,
#dropZone,
#upload-zone,
#manual-processing-dropzone,
[id*="dropzone"] {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-secondary) !important;
  transition: all 0.2s ease !important;
}

.upload-zone:hover,
#dropZone:hover,
#upload-zone:hover,
#manual-processing-dropzone:hover,
[id*="dropzone"]:hover {
  background-color: var(--bg-tertiary) !important;
  border-color: var(--primary) !important;
}

.upload-zone i,
#dropZone i,
#upload-zone i,
#manual-processing-dropzone i,
[id*="dropzone"] i {
  color: var(--text-tertiary) !important;
}

/* === TABLES === */
table {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
}

th {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--border-medium) !important;
}

td {
  color: var(--text-secondary) !important;
  font-family: var(--font-secondary) !important;
  border-bottom: 1px solid var(--border-light) !important;
}

tr:hover {
  background-color: var(--bg-secondary) !important;
}

/* === ACCOUNTING SPECIFIC === */
.debit-amount {
  color: var(--debit-color) !important;
  font-family: var(--font-mono) !important;
  font-weight: 600 !important;
}

.credit-amount {
  color: var(--credit-color) !important;
  font-family: var(--font-mono) !important;
  font-weight: 600 !important;
}

.balance-amount {
  color: var(--balance-color) !important;
  font-family: var(--font-mono) !important;
  font-weight: 700 !important;
}

.konto-code {
  color: var(--konto-color) !important;
  font-family: var(--font-mono) !important;
  font-weight: 500 !important;
}

/* === JOURNAL ENTRIES === */
.journal-entry {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-lg) !important;
  margin-bottom: var(--space-md) !important;
  transition: all 0.2s ease !important;
}

.journal-entry:hover {
  border-color: var(--border-medium) !important;
  box-shadow: var(--shadow-md) !important;
}

.journal-entry-header {
  color: var(--text-primary) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  margin-bottom: var(--space-sm) !important;
}

.journal-entry-field {
  color: var(--text-secondary) !important;
  font-family: var(--font-secondary) !important;
  margin-bottom: var(--space-xs) !important;
}

/* === MODALS === */
.modal {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-xl) !important;
  border-radius: var(--radius-xl) !important;
}

.modal-header {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-light) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
}

/* === LOADING STATES === */
.loading-spinner {
  border-color: var(--border-light) !important;
  border-top-color: var(--primary) !important;
}

/* === STATUS INDICATORS === */
.status-pending {
  background-color: var(--warning-light) !important;
  color: var(--warning-dark) !important;
  border: 1px solid var(--warning) !important;
}

.status-approved {
  background-color: var(--success-light) !important;
  color: var(--success-dark) !important;
  border: 1px solid var(--success) !important;
}

.status-rejected {
  background-color: var(--danger-light) !important;
  color: var(--danger-dark) !important;
  border: 1px solid var(--danger) !important;
}

/* === DOCUMENT ACTIONS SECTION === */
.document-actions-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  color: var(--text-primary) !important;
}

.current-doc-info {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  color: var(--text-primary) !important;
}

/* ========================================
   ACCESSIBILITY & PRINT STYLES
   ======================================== */

/* Focus indicators */
*:focus {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* Print styles */
@media print {
  * {
    background-color: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .no-print {
    display: none !important;
  }
}

/* ========================================
   RESPONSIVE OVERRIDES
   ======================================== */

@media (max-width: 768px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.5rem;
  }
  
  .journal-entry {
    padding: var(--space-md) !important;
  }
}

/* ========================================
   DEPARTMENTS MODAL LIGHT THEME
   ======================================== */

/* Settings tabs */
.settings-tab {
  color: var(--text-tertiary) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.2s ease !important;
}

.settings-tab:hover {
  color: var(--text-secondary) !important;
}

.settings-tab.active-tab {
  color: #121e60 !important;
  border-bottom-color: #121e60 !important;
}

/* Modal background and content */
#settings-modal .flex.flex-col {
  background-color: var(--bg-primary) !important;
}

/* Form sections light theme styling */
.form-section {
  margin-bottom: 1.5rem !important;
  padding-bottom: 1.5rem !important;
  border-bottom: 1px solid var(--border-light) !important;
}

.form-section:last-of-type {
  border-bottom: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.form-section h4 {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  margin-bottom: 1rem !important;
}

/* Toggle switch light theme styling */
.toggle-slider {
  background-color: #dc2626 !important; /* Red when OFF */
  transition: 0.4s !important;
  border-radius: 24px !important;
}

.toggle-slider:before {
  background-color: white !important;
  transition: 0.4s !important;
  border-radius: 50% !important;
}

input:checked + .toggle-slider {
  background-color: #0D4D3B !important; /* Green when ON */
}

input:checked + .toggle-slider:before {
  transform: translateX(20px) !important;
}

/* Form inputs and textareas specific styling */
.form-group input[type="text"],
.form-group input[type="email"], 
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-medium) !important;
  color: var(--text-primary) !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem !important;
  transition: border-color 0.2s ease !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-light) !important;
}

.form-group label {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
  margin-bottom: 0.5rem !important;
}

/* ========================================
   BUTTON OVERRIDES FOR LIGHT THEME
   ======================================== */

/* Override for New Client button - light grey theme */
html.light #create-new-client-btn,
.light #create-new-client-btn,
html.light #create-new-client-btn *,
.light #create-new-client-btn * {
  background-color: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #9ca3af !important;
}

html.light #create-new-client-btn:hover,
.light #create-new-client-btn:hover {
  background-color: #e5e7eb !important;
}

/* Override for Upload Documents button */
html.light #upload-documents-btn,
.light #upload-documents-btn,
html.light #upload-documents-btn *,
.light #upload-documents-btn * {
  background-color: #121e60 !important;
  color: #ffffff !important;
}

html.light #upload-documents-btn:hover,
.light #upload-documents-btn:hover {
  background-color: #12398b !important;
}

/* Override for Journal Manager button */
html.light a[href="/journal-manager"],
.light a[href="/journal-manager"],
html.light a[href="/journal-manager"] *,
.light a[href="/journal-manager"] * {
  background-color: #121e60 !important;
  color: #ffffff !important;
}

html.light a[href="/journal-manager"]:hover,
.light a[href="/journal-manager"]:hover {
  background-color: #6d28d9 !important;
}

/* ========================================
   DARK MODE COMPATIBILITY
   ======================================== */

/* Ensure light theme always takes precedence */
@media (prefers-color-scheme: dark) {
  /* 
  html.light,
  html.light *,
  .light,
  .light * {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
  }
   */
  /* Override for specific branded buttons that should maintain their colors */
  html.light a[href="/journal-manager"],
  .light a[href="/journal-manager"],
  html.light a[href="/journal-manager"] *,
  .light a[href="/journal-manager"] * {
    background-color: #121e60 !important;
    color: #ffffff !important;
  }
  
  html.light a[href="/journal-manager"]:hover,
  .light a[href="/journal-manager"]:hover {
    background-color: #6d28d9 !important;
  }
  
  /* Override for New Client button - light grey theme */
  html.light #create-new-client-btn,
  .light #create-new-client-btn,
  html.light #create-new-client-btn *,
  .light #create-new-client-btn * {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border-color: #9ca3af !important;
  }
  
  html.light #create-new-client-btn:hover,
  .light #create-new-client-btn:hover {
    background-color: #e5e7eb !important;
  }
  
  /* Override for Upload Documents button */
  html.light #upload-documents-btn,
  .light #upload-documents-btn,
  html.light #upload-documents-btn *,
  .light #upload-documents-btn * {
    background-color: #121e60 !important;
    color: #ffffff !important;
  }
  
  html.light #upload-documents-btn:hover,
  .light #upload-documents-btn:hover {
    background-color: #12398b !important;
  }
} 