/* CASTRUM - Theme System (Light & Dark Mode)
----------------------------------------
* CSS variables for light and dark themes
* Applied via data-theme attribute on body
*/

/* Light Theme (Default) */
:root,
[data-theme="light"] {

  /*  --color-primary: #2c3e50; */

  /* Primary Colors */
  --color-primary: #2c3e50;
  --color-secondary: #d3d3d3;
  --color-accent: #e74c3c;
  --color-success: #354a0a;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;
  --color-info: #3498db;
  
  /* Background Colors */
  --background-color: #F4F4F4;
  --card-background: #ffffff;
  --header-background: var(--color-primary);
  --sidebar-background: #34495e;
  
  /* Text Colors */
  --text-color: #2c3e50;
  --text-color-secondary: #313131;
  --text-color-inverse: #ffffff;
  --text-color-muted: #95a5a6;
  --text-color-header-nav-link: #ffffff;
  
  
  /* Border Colors */
  --border-color: #ddd;
  --border-color-light: #ecf0f1;
  --border-color-dark: #bdc3c7;

  --info-color: #264f6b;
  


  /* Table Colors */
  --table-header-bg: var(--color-primary);
  --table-header-text: #ffffff;
  --table-row-bg: #ffffff;
  --table-row-alt-bg: #faf8f8;
  /*--table-hover-bg: #4b5d5d;*/
  --table-hover-bg: oklch(from var(--color-primary) calc(l + 0.1) c h);
  --table-hover-text:#ffffff;
  --table-border: #ddd;
  --table-highlight-bg: #FFF1E5;
  --table-totals-row-bg: #f0f4f8;
  
  /* AG Grid Theme Colors 
    MOVED TO AG THEME CSS
  */

  /* CASH FLOW TABLE */
  --cash-flow-table-header-bg: var(--color-primary);
  --cash-flow-table-header-text: #ffffff;
  
  
  /* Button Colors */
  --btn-primary-bg: #3498db;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #95a5a6;
  --btn-secondary-text: #ffffff;
  --btn-success-bg: #27ae60;
  --btn-danger-bg: #e74c3c;
  
  /* Input Colors */
  --input-bg: #ffffff;
  --input-border: #ddd;
  --input-text: #2c3e50;
  --input-focus-border: #3498db;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  
  /* Table Cell Padding */
  --table-cell-padding-top: 2px;
  --table-cell-padding-right: 4px;
  --table-cell-padding-bottom: 2px;
  --table-cell-padding-left: 4px;
  
  /* Table Content Spacing */
  --table-content-padding: 16px;
  --table-content-margin-bottom: 20px;
  
  /* Misc */
  --white: #ffffff;
  --black: #000000;

  --font-size-table: 12px;
}

/* Dark Theme */
[data-theme="dark"] {
  /* Color palette - dark theme */
  --color-primary: #1a2530;
  --color-primary-light: #2a3a4a;
  --color-primary-dark: #0d141a;

  --color-secondary: #2980b9;
  --color-secondary-light: #3498db;
  --color-secondary-dark: #1f6aa6;

  --color-accent: #16a085;
  --color-accent-light: #1abc9c;
  --color-accent-dark: #0e6b58;

  /* Applied colors */
  --text-color: #e0e0e0;
  --text-color-secondary: #b0b0b0;
  --text-color-muted: #909090;
  --text-color-inverse: #ffc4c4;
  --text-color-header-nav-link: #ffffff;

  --background-color: #1a1a1a;
  --card-background: #2a2a2a;
  --card-background-alt: #333333;
  --header-background: #1a2530;
  --sidebar-background: #1a2530;

  --border-color: #555555;
  --border-color-light: #666666;
  --border-color-dark: #444444;

  --hover-color: #3a3a3a;
  --active-color: #444444;
  --focus-color: rgba(41, 128, 185, 0.25);

  --shadow-color: rgba(0, 0, 0, 0.3);

  /* Form elements */
  --input-bg: #333333;
  --input-border: #555555;
  --input-text: #e0e0e0;
  --input-placeholder: #aaaaaa;
  --input-bg-disabled: #2a2a2a;
  --input-focus-border: #3671b9;

  /* Buttons */
  --btn-primary-bg: #2980b9;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #444444;
  --btn-secondary-text: #e0e0e0;
  --btn-success-bg: #2e7d32;
  --btn-danger-bg: #c62828;

  --button-bg: #444444;
  --button-text: #e0e0e0;
  --button-border: #555555;
  --button-hover-bg: #555555;
  --button-hover-text: #ffffff;
  --button-hover-border: #666666;
  --button-active-bg: #333333;
  --button-active-text: #ffffff;
  --button-active-border: #444444;
  --button-disabled-bg: #333333;
  --button-disabled-text: #777777;
  --button-disabled-border: #444444;

  /* Tables */
  --table-header-bg: #333333;
  --table-header-text: #e0e0e0;
  --table-row-bg: #2a2a2a;
  --table-row-alt-bg: #333333;
  --table-border: #555555;
  --table-hover-bg: #3a3a3a;
  --table-highlight-bg: #598181;

  

  /* Modals */
  --modal-bg: #333333;
  --modal-header-bg: #444444;
  --modal-footer-bg: #444444;
  --modal-border: #555555;
  --modal-shadow: rgba(0, 0, 0, 0.4);

  /* Console styles */
  --console-bg: #1e1e1e;
  --console-text: #f0f0f0;
  --console-header-bg: #333333;
  --console-border: #555555;
  --console-prompt: #64b5f6;
  --console-timestamp: #888888;
  --console-info: #64b5f6;
  --console-success: #7eff84;
  --console-warning: #ffd166;
  --console-error: #ff6b6b;

  /* Semantic colors */
  --color-success: #2e7d32;
  --color-success-light: #7eff84;
  --color-success-dark: #1b4a1e;

  --color-info: #1976d2;
  --color-info-light: #64b5f6;
  --color-info-dark: #1a3c5e;

  --color-warning: #f57c00;
  --color-warning-light: #ffd166;
  --color-warning-dark: #5e4813;

  --color-danger: #c62828;
  --color-danger-light: #ff6b6b;
  --color-danger-dark: #4d1515;

  /* AG Grid theme */
  --ag-header-foreground-color: #ffffff;
  --ag-header-background-color: #1a1f3d;
  --ag-odd-row-background-color: #2a2a2a;
  --ag-background-color: #222222;
  --ag-row-hover-color: #3a3a3a;
  --ag-selected-row-background-color: #4a4a4a;
  --ag-foreground-color: #e0e0e0;
  --ag-border-color: #555555;
  --ag-row-border-color: #555555;
  --ag-alpine-active-color: #3671b9;
  --ag-input-focus-border-color: #3671b9;
  --ag-range-selection-border-color: #3671b9;
  --ag-range-selection-background-color: #3671b933;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  
  /* Table Cell Padding */
  --table-cell-padding-top: 8px;
  --table-cell-padding-right: 12px;
  --table-cell-padding-bottom: 8px;
  --table-cell-padding-left: 12px;
  
  /* Table Content Spacing */
  --table-content-padding: 16px;
  --table-content-margin-bottom: 20px;
  
  /* Misc */
  --white: #ffffff;
  --black: #000000;
}

/* Smooth transitions for theme changes */
body,
.card,
.header,
.sidebar,
input,
button,
.ag-theme-castrum {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
