/* Base layout and common styles */

/* CSS Variables - Design System */
:root {
  /* Colors - Primary */
  --color-primary: #E63946;
  --color-primary-dark: #D62839;
  --color-primary-light: #FF6B6B;

  /* Colors - Blue (Secondary) */
  --color-blue: #3e96ff;
  --color-blue-dark: #2b7de9;
  --color-blue-light: #6bb3ff;

  /* Colors - Neutral */
  --color-dark: #20212D;
  --color-dark-hover: #494A56;
  --color-gray-900: #1a1a2e;
  --color-gray-800: #2d2d44;
  --color-gray-700: #404058;
  --color-gray-600: #6b7280;
  --color-gray-500: #9ca3af;
  --color-gray-400: #c4c4c4;
  --color-gray-300: #d1d5db;
  --color-gray-200: #e5e7eb;
  --color-gray-100: #f3f4f6;
  --color-gray-50: #f9fafb;
  --color-white: #ffffff;

  /* Colors - Semantic */
  --color-success: #10B981;
  --color-success-light: #D1FAE5;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF3C7;
  --color-error: #EF4444;
  --color-error-light: #FEE2E2;
  --color-info: #3B82F6;
  --color-info-light: #DBEAFE;

  /* Colors - Categories */
  --color-category-insurance: #10B981;
  --color-category-housing: #8B5CF6;
  --color-category-vehicle: #06B6D4;
  --color-category-financial: #F59E0B;
  --color-category-family: #EC4899;
  --color-category-other: #6B7280;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 500;
  --z-tooltip: 600;
  --z-toast: 700;
}

/* TB Brand Colors */
:root {
    /* Primary */
    --tb-dark: #20212D;
    --tb-border: #E5E5E5;
    --tb-white: #ffffff;
    --tb-blue: #3E96FF;
    --tb-red: #D33F49;
    --tb-green: #38B267;
    --tb-orange: #EEA207;
    --tb-purple: #AC5DFF;

    /* Secondary */
    --tb-dark-grey: #494A56;
    --tb-grey: #747474;
    --tb-light-grey: #C8C6C6;
    --tb-blue-light: #B9D9FF;
    --tb-pink: #3E96FF;
    --tb-green-light: #C2F6D6;
    --tb-yellow-light: #FEEBC3;
    --tb-purple-light: #E2CBFF;

    /* Backgrounds */
    --tb-bg: #fafafa;
    --tb-background: #fafafa;
    --tb-pink-bg: #F8E8E8;
    --tb-green-bg: rgba(56,178,103,0.2);
    --tb-red-bg: rgba(211,63,73,0.2);
    --tb-orange-bg: rgba(238,162,7,0.2);
    --tb-grey-bg: rgba(200,198,198,0.25);
    --tb-blue-bg: rgba(62,150,255,0.2);
}

/* Body and main layout */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: auto;
  background-color: #fff;
}

.main-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.main-content-wrapper {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  transition: margin-left 0.3s ease;
}

.main-content {
  flex: 1;
  padding: 32px 48px 48px 48px;
}

/* Page Footer */
.page-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: var(--space-4, 16px) var(--space-6, 24px);
  text-align: center;
  width: 100%;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
  margin-bottom: var(--space-1, 4px);
}

.footer-links a {
  color: var(--color-gray-400, #c4c4c4);
  text-decoration: none;
  font-size: var(--font-size-xs, 12px);
  transition: color var(--transition-fast, 0.15s);
}

.footer-links a:hover {
  color: var(--color-gray-600, #6b7280);
}

.footer-divider {
  color: var(--color-gray-300, #d1d5db);
  font-size: var(--font-size-xs, 12px);
}

.footer-copyright {
  color: var(--color-gray-400, #c4c4c4);
  font-size: 10px;
  margin: 0;
}

/* Mobile hamburger menu button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: #20212D;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-toggle.hidden {
  opacity: 0;
  visibility: hidden;
}

.mobile-menu-toggle:hover {
  background: #494A56;
}

.mobile-menu-toggle svg {
  width: 20px;
  height: 20px;
}

/* Toast notification system */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  max-width: 300px;
  word-wrap: break-word;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  background: #28a745;
}

.toast.error {
  background: #dc3545;
}

.toast.info {
  background: #17a2b8;
}

.toast.warning {
  background: #ffc107;
  color: #333;
}

/* Drag and drop visual feedback - DISABLED (using specific dropzone instead) */
/* body.drag-over {
  background-color: rgba(0, 123, 255, 0.1);
}

body.drag-over::before {
  content: "Drop files here to upload";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 123, 255, 0.9);
  color: white;
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  z-index: 1000;
  pointer-events: none;
} */

/* Modal styles */
.modal-input-group {
  margin: 16px 0;
}

.modal-input-group .form-input {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  transition: border-color 0.2s;
}

.modal-input-group .form-input:focus {
  outline: none;
  border-color: #20212D;
}

.modal-cancel-btn {
  display: none;
}

.modal-confirm-btn {
  display: none;
}


/* Responsive design - mobile and landscape */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .main-content-wrapper {
    margin-left: 0;
  }
  
  .main-content {
    padding: 8px 12px 16px 12px;
    margin-top: 50px; /* Reduced space for mobile menu button */
  }
  
  .toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    max-width: none;
    font-size: 13px;
    padding: 10px 16px;
  }
  
  /* Reduce overall font sizes on mobile */
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 24px;
    margin-bottom: 12px;
  }
  
  h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px 16px 20px 16px;
  }
}
