/* TreasureFinder Design System v2.0
   Luxury-Grade UI Framework for Data-Driven Wealth Discovery
   
   Architecture:
   - 12-point spacing scale (4px base unit)
   - Premium serif + sans-serif typography hierarchy
   - Light & dark theme support
   - Optimized for luxury + data clarity
   - Accessible components with keyboard navigation
*/

/* ========================================
   1. DESIGN TOKENS & THEME VARIABLES
   ======================================== */

:root {
  /* Color Palette - Light Theme (Default) */
  --color-bg-primary: #F8F6F2;
  --color-bg-secondary: #F1EEE7;
  --color-bg-elevated: #FFFFFF;
  
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #555555;
  --color-text-tertiary: #6E6E6E;
  --color-text-muted: #A0A0A0;
  
  --color-accent-primary: #C9A86A;
  --color-accent-primary-light: #D9B87A;
  --color-accent-primary-dark: #B9985A;
  --color-accent-secondary: #A08850;
  
  --color-accent-soft: #E2D2AF;
  --color-accent-lighter: #F3ECDF;
  
  --color-status-success: #2ECC71;
  --color-status-warning: #F39C12;
  --color-status-danger: #C0392B;
  --color-status-info: #3498DB;
  
  --color-border-light: #E8E8E8;
  --color-border-medium: #D5D5D5;
  --color-border-dark: #C0C0C0;
  
  /* Typography - Font Stack */
  --font-family-serif: "Georgia", "Garamond", "Baskerville", "Palatino Linotype", "Book Antiqua", serif;
  --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Arial", sans-serif;
  --font-family-mono: "SF Mono", "Monaco", "Cascadia Code", "Menlo", monospace;
  
  /* Spacing Scale - 12-point (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 56px;
  --space-10: 64px;
  
  /* Typography Scale */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 30px;
  --font-size-3xl: 36px;
  --font-size-4xl: 48px;
  
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;
  --line-height-loose: 1.8;
  
  /* Border Radius - Design Scale */
  --radius-none: 0px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows - Luxury Depth */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-hide: -1;
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-tooltip: 60;
  --z-notification: 70;
  
  /* Container / Layout - Max Widths */
  --max-width-container: 1200px;
  --max-width-container-sm: 768px;
  --max-width-container-lg: 1400px;
  --max-width-container-wide: 100%;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #1A1A1A;
    --color-bg-secondary: #242424;
    --color-bg-elevated: #2D2D2D;
    
    --color-text-primary: #F5F5F5;
    --color-text-secondary: #D0D0D0;
    --color-text-tertiary: #A0A0A0;
    --color-text-muted: #707070;
    
    --color-border-light: #404040;
    --color-border-medium: #505050;
    --color-border-dark: #606060;
  }
}

/* ========================================
   2. GLOBAL BASE STYLES
   ======================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-base);
  transition: background-color 0.3s ease;
}

/* ========================================
   3. TYPOGRAPHY HIERARCHY
   ======================================== */

/* Display Headings */
h1 {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-4xl);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-5) 0;
  line-height: var(--line-height-tight);
}

h2 {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-tight);
}

h3 {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-tight);
}

h4 {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-tight);
}

h5 {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--line-height-tight);
}

h6 {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2) 0;
}

p {
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
  position: relative;
}

a:hover {
  color: var(--color-accent-primary);
}

a:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

code, pre {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

code {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  display: inline-block;
}

pre {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 0 0 var(--space-4) 0;
}

/* ========================================
   4. CONTAINER & LAYOUT
   ======================================== */

.tf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.tf-container-sm {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.tf-container-lg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.tf-container-wide {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ========================================
   5. BUTTON STYLES - UNIFIED SYSTEM
   ======================================== */

/* Base Button Reset */
button, .tf-btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
}

button:disabled, .tf-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:focus-visible, .tf-btn:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* Primary Button - Luxury Gold Accent */
.tf-btn-primary {
  background-color: var(--color-accent-primary);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.tf-btn-primary:hover:not(:disabled) {
  background-color: var(--color-accent-primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.tf-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button - Outline */
.tf-btn-secondary {
  background-color: transparent;
  color: var(--color-accent-secondary);
  border: 2px solid var(--color-accent-primary);
}

.tf-btn-secondary:hover:not(:disabled) {
  background-color: var(--color-accent-lighter);
  border-color: var(--color-accent-primary-dark);
}

/* Ghost Button - Minimal */
.tf-btn-ghost {
  background-color: transparent;
  color: var(--color-accent-secondary);
  box-shadow: none;
}

.tf-btn-ghost:hover:not(:disabled) {
  background-color: var(--color-bg-secondary);
  color: var(--color-accent-primary);
}

/* Danger Button */
.tf-btn-danger {
  background-color: var(--color-status-danger);
  color: #FFFFFF;
}

.tf-btn-danger:hover:not(:disabled) {
  background-color: #A0301F;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Success Button */
.tf-btn-success {
  background-color: var(--color-status-success);
  color: #FFFFFF;
}

.tf-btn-success:hover:not(:disabled) {
  background-color: #25A25A;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Button Sizes */
.tf-btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-sm);
  min-height: 32px;
}

.tf-btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-lg);
  min-height: 48px;
}

.tf-btn-block {
  width: 100%;
  display: flex;
}

/* ========================================
   6. CARD STYLES - UNIFIED SYSTEM
   ======================================== */

.tf-card {
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: var(--transition-base);
  border: 1px solid var(--color-border-light);
}

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

.tf-card-compact {
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  transition: var(--transition-base);
  border: 1px solid var(--color-border-light);
}

.tf-card-compact:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.tf-card-flat {
  background-color: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: var(--transition-base);
}

.tf-card-flat:hover {
  border-color: var(--color-accent-primary);
  background-color: var(--color-accent-lighter);
}

.tf-card-elevated {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-secondary) 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  transition: var(--transition-base);
  border: none;
}

.tf-card-elevated:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-4px);
}

.tf-card-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.tf-card-body {
  margin: var(--space-4) 0;
}

.tf-card-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ========================================
   7. FORM CONTROLS - UNIFIED SYSTEM
   ======================================== */

.tf-form-group {
  margin-bottom: var(--space-6);
}

.tf-form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
}

.tf-form-group .tf-form-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
}

/* Text Input, Email, Password, URL */
.tf-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-family: inherit;
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  transition: var(--transition-base);
  box-sizing: border-box;
}

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

.tf-input:hover:not(:disabled) {
  border-color: var(--color-border-medium);
}

.tf-input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.1);
  background-color: var(--color-bg-elevated);
}

.tf-input:disabled {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.tf-input.tf-input-error {
  border-color: var(--color-status-danger);
}

.tf-input.tf-input-error:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.tf-input.tf-input-success {
  border-color: var(--color-status-success);
}

.tf-input.tf-input-success:focus {
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

/* Textarea */
.tf-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-family: inherit;
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  transition: var(--transition-base);
  box-sizing: border-box;
  min-height: 120px;
  resize: vertical;
  line-height: var(--line-height-relaxed);
}

.tf-textarea::placeholder {
  color: var(--color-text-muted);
}

.tf-textarea:hover:not(:disabled) {
  border-color: var(--color-border-medium);
}

.tf-textarea:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.1);
}

.tf-textarea:disabled {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Select */
.tf-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-family: inherit;
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  transition: var(--transition-base);
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 1.5em;
  padding-right: calc(var(--space-4) + 1.5em);
}

.tf-select:hover:not(:disabled) {
  border-color: var(--color-border-medium);
}

.tf-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.1);
}

.tf-select:disabled {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Checkbox & Radio */
.tf-checkbox, .tf-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-accent-primary);
  transition: var(--transition-base);
}

.tf-checkbox:focus-visible, .tf-radio:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

.tf-checkbox:disabled, .tf-radio:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Checkbox & Radio Container */
.tf-checkbox-group, .tf-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tf-checkbox-item, .tf-radio-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.tf-checkbox-item label, .tf-radio-item label {
  cursor: pointer;
  margin: 0;
  font-weight: 500;
}

/* Error Message */
.tf-form-error {
  color: var(--color-status-danger);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.tf-form-help {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

/* ========================================
   8. TOOLTIP STYLES
   ======================================== */

.tf-tooltip {
  position: relative;
  display: inline-block;
}

.tf-tooltip-content {
  visibility: hidden;
  background-color: var(--color-text-primary);
  color: var(--color-bg-primary);
  text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: calc(100% + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.tf-tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--color-text-primary) transparent transparent transparent;
}

.tf-tooltip:hover .tf-tooltip-content,
.tf-tooltip:focus-within .tf-tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Tooltip Directions */
.tf-tooltip-right .tf-tooltip-content {
  bottom: auto;
  left: calc(100% + var(--space-3));
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.tf-tooltip-right .tf-tooltip-content::after {
  top: 50%;
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-top: -5px;
  border-color: transparent var(--color-text-primary) transparent transparent;
}

.tf-tooltip-bottom .tf-tooltip-content {
  bottom: auto;
  top: calc(100% + var(--space-3));
  transform: translateX(-50%);
}

.tf-tooltip-bottom .tf-tooltip-content::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent var(--color-text-primary) transparent;
}

/* ========================================
   9. BADGE & STATUS INDICATORS
   ======================================== */

.tf-badge {
  display: inline-block;
  background-color: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tf-badge-success {
  background-color: rgba(46, 204, 113, 0.15);
  color: var(--color-status-success);
}

.tf-badge-danger {
  background-color: rgba(192, 57, 43, 0.15);
  color: var(--color-status-danger);
}

.tf-badge-warning {
  background-color: rgba(243, 156, 18, 0.15);
  color: var(--color-status-warning);
}

.tf-badge-info {
  background-color: rgba(52, 152, 219, 0.15);
  color: var(--color-status-info);
}

.tf-badge-accent {
  background-color: rgba(201, 168, 106, 0.15);
  color: var(--color-accent-primary);
}

/* ========================================
   10. ALERT & MESSAGE STYLES
   ======================================== */

.tf-alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-accent-primary);
  background: linear-gradient(135deg, rgba(201, 168, 106, 0.08) 0%, rgba(201, 168, 106, 0.03) 100%);
  margin-bottom: var(--space-4);
}

.tf-alert p {
  margin: 0;
  color: var(--color-text-secondary);
}

.tf-alert-danger {
  border-left-color: var(--color-status-danger);
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.08) 0%, rgba(192, 57, 43, 0.03) 100%);
}

.tf-alert-success {
  border-left-color: var(--color-status-success);
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.03) 100%);
}

.tf-alert-warning {
  border-left-color: var(--color-status-warning);
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.08) 0%, rgba(243, 156, 18, 0.03) 100%);
}

.tf-alert-info {
  border-left-color: var(--color-status-info);
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.03) 100%);
}

/* ========================================
   11. SPACING UTILITIES
   ======================================== */

/* Margin */
.tf-m-0 { margin: 0; }
.tf-m-1 { margin: var(--space-1); }
.tf-m-2 { margin: var(--space-2); }
.tf-m-3 { margin: var(--space-3); }
.tf-m-4 { margin: var(--space-4); }
.tf-m-5 { margin: var(--space-5); }
.tf-m-6 { margin: var(--space-6); }

.tf-mb-0 { margin-bottom: 0; }
.tf-mb-1 { margin-bottom: var(--space-1); }
.tf-mb-2 { margin-bottom: var(--space-2); }
.tf-mb-3 { margin-bottom: var(--space-3); }
.tf-mb-4 { margin-bottom: var(--space-4); }
.tf-mb-5 { margin-bottom: var(--space-5); }
.tf-mb-6 { margin-bottom: var(--space-6); }

.tf-mt-0 { margin-top: 0; }
.tf-mt-1 { margin-top: var(--space-1); }
.tf-mt-2 { margin-top: var(--space-2); }
.tf-mt-3 { margin-top: var(--space-3); }
.tf-mt-4 { margin-top: var(--space-4); }
.tf-mt-5 { margin-top: var(--space-5); }
.tf-mt-6 { margin-top: var(--space-6); }

.tf-mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.tf-p-0 { padding: 0; }
.tf-p-1 { padding: var(--space-1); }
.tf-p-2 { padding: var(--space-2); }
.tf-p-3 { padding: var(--space-3); }
.tf-p-4 { padding: var(--space-4); }
.tf-p-5 { padding: var(--space-5); }
.tf-p-6 { padding: var(--space-6); }

.tf-px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.tf-px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.tf-px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.tf-px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }

.tf-py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.tf-py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.tf-py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.tf-py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Gap */
.tf-gap-1 { gap: var(--space-1); }
.tf-gap-2 { gap: var(--space-2); }
.tf-gap-3 { gap: var(--space-3); }
.tf-gap-4 { gap: var(--space-4); }
.tf-gap-5 { gap: var(--space-5); }
.tf-gap-6 { gap: var(--space-6); }

/* ========================================
   12. FLEXBOX UTILITIES
   ======================================== */

.tf-flex {
  display: flex;
  gap: var(--space-3);
}

.tf-flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tf-flex-row {
  display: flex;
  flex-direction: row;
  gap: var(--space-3);
}

.tf-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.tf-flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
}

.tf-flex-start {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--space-3);
}

.tf-flex-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
}

.tf-flex-wrap {
  flex-wrap: wrap;
}

.tf-flex-1 { flex: 1; }
.tf-flex-grow { flex-grow: 1; }
.tf-flex-shrink-0 { flex-shrink: 0; }

/* ========================================
   13. GRID UTILITIES
   ======================================== */

.tf-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 2fr 1fr;
}

.tf-grid-2 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1fr;
}

.tf-grid-3 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1fr;
}

.tf-grid-4 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .tf-grid, .tf-grid-2, .tf-grid-3, .tf-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   14. TEXT UTILITIES
   ======================================== */

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

.tf-text-primary { color: var(--color-text-primary); }
.tf-text-secondary { color: var(--color-text-secondary); }
.tf-text-muted { color: var(--color-text-muted); }
.tf-text-accent { color: var(--color-accent-primary); }

.tf-text-xs { font-size: var(--font-size-xs); }
.tf-text-sm { font-size: var(--font-size-sm); }
.tf-text-base { font-size: var(--font-size-base); }
.tf-text-lg { font-size: var(--font-size-lg); }
.tf-text-xl { font-size: var(--font-size-xl); }

.tf-font-light { font-weight: 300; }
.tf-font-normal { font-weight: 400; }
.tf-font-medium { font-weight: 500; }
.tf-font-semibold { font-weight: 600; }
.tf-font-bold { font-weight: 700; }

.tf-uppercase { text-transform: uppercase; }
.tf-lowercase { text-transform: lowercase; }
.tf-capitalize { text-transform: capitalize; }

.tf-italic { font-style: italic; }
.tf-underline { text-decoration: underline; }
.tf-line-through { text-decoration: line-through; }

/* ========================================
   15. DISPLAY & VISIBILITY
   ======================================== */

.tf-block { display: block; }
.tf-inline { display: inline; }
.tf-inline-block { display: inline-block; }
.tf-hidden { display: none; }
.tf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   16. BORDER & DIVIDER STYLES
   ======================================== */

.tf-divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-5) 0;
}

.tf-divider-vertical {
  border: none;
  border-left: 1px solid var(--color-border-light);
  height: 100%;
  margin: 0 var(--space-4);
}

.tf-border {
  border: 1px solid var(--color-border-light);
}

.tf-border-t {
  border-top: 1px solid var(--color-border-light);
}

.tf-border-b {
  border-bottom: 1px solid var(--color-border-light);
}

.tf-border-l {
  border-left: 1px solid var(--color-border-light);
}

.tf-border-r {
  border-right: 1px solid var(--color-border-light);
}

/* ========================================
   17. SHADOW UTILITIES
   ======================================== */

.tf-shadow-none { box-shadow: none; }
.tf-shadow-xs { box-shadow: var(--shadow-xs); }
.tf-shadow-sm { box-shadow: var(--shadow-sm); }
.tf-shadow-md { box-shadow: var(--shadow-md); }
.tf-shadow-lg { box-shadow: var(--shadow-lg); }
.tf-shadow-xl { box-shadow: var(--shadow-xl); }
.tf-shadow-2xl { box-shadow: var(--shadow-2xl); }

/* ========================================
   18. ACCESSIBILITY & FOCUS STATES
   ======================================== */

:focus-visible {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: more) {
  :root {
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* ========================================
   19. RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 1024px) {
  .tf-container {
    max-width: 960px;
    padding: 0 var(--space-5);
  }

  .tf-container-lg {
    padding: 0 var(--space-5);
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 768px) {
  .tf-container {
    max-width: 100%;
    padding: 0 var(--space-4);
  }

  .tf-container-lg,
  .tf-container-wide {
    padding: 0 var(--space-4);
  }

  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  .tf-grid-2, .tf-grid-3, .tf-grid-4 {
    grid-template-columns: 1fr;
  }

  .tf-flex-col-reverse-mobile {
    flex-direction: column-reverse;
  }
}

@media (max-width: 480px) {
  .tf-container {
    padding: 0 var(--space-3);
  }

  h1 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
  }

  h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
  }

  .tf-card {
    padding: var(--space-4);
  }

  .tf-card-compact {
    padding: var(--space-3);
  }

  button, .tf-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   19. DEMO MODE STYLES
   ======================================== */

/* Demo Mode Badge - Subtle but visible indicator */
.demo-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-status-warning);
  border-radius: 4px;
  margin-right: var(--space-3);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.demo-mode-badge:hover {
  opacity: 1;
}

.demo-badge-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Demo Mode Badge in Admin Views */
.admin-demo-badge {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-status-warning);
  color: #FFFFFF;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

/* Demo Mode notification in header */
.demo-mode-header {
  background: linear-gradient(90deg, var(--color-status-warning), var(--color-accent-secondary));
  color: #FFFFFF;
  padding: var(--space-3) var(--space-4);
  border-radius: 4px;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* ========================================
   20. PRINT STYLES
   ======================================== */

@media print {
  body {
    background: white;
  }

  .tf-no-print {
    display: none;
  }

  a {
    text-decoration: underline;
  }

  .tf-btn {
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .demo-mode-badge,
  .admin-demo-badge,
  .demo-mode-header {
    display: none;
  }
}

/* ========================================
   SEARCH MODE CONTROL - PROFESSIONAL STYLING
   ======================================== */

.search-mode-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--color-border-light);
  border-radius: 8px;
  font-size: var(--font-size-base);
  font-family: inherit;
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(201, 168, 106, 0.08);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231A1A1A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.search-mode-select:hover:not(:disabled) {
  border-color: var(--color-accent-primary);
  box-shadow: 0 4px 12px rgba(201, 168, 106, 0.15);
}

.search-mode-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.15);
}

.search-mode-select:disabled {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.search-mode-description {
  color: var(--color-text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  padding: 0.5rem 0;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-mode-info-icon {
  transition: all 0.2s ease;
}

.search-mode-info-icon:hover {
  background-color: var(--color-accent-primary-dark) !important;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(201, 168, 106, 0.3);
}

.pro-badge-hint {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-mode-container {
  position: relative;
}

@media (max-width: 768px) {
  .search-mode-select {
    padding: 0.75rem 0.85rem;
    padding-right: 2.2rem;
    font-size: 0.95rem;
  }
  
  .search-mode-description {
    font-size: 0.8rem;
  }
}

/* ========================================
   21. MODAL & DIALOG STYLES
   ======================================== */

/* Modal Backdrop */
.tf-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 26, 26, 0.5);
  z-index: var(--z-modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
}

.tf-modal-backdrop.tf-modal-open {
  display: flex;
}

/* Modal Container */
.tf-modal {
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal Header */
.tf-modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tf-modal-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-family-serif);
}

.tf-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  border-radius: var(--radius-lg);
}

.tf-modal-close:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-secondary);
}

/* Modal Body */
.tf-modal-body {
  padding: var(--space-6);
}

/* Modal Footer */
.tf-modal-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Modal Sizes */
.tf-modal-lg {
  max-width: 700px;
}

.tf-modal-sm {
  max-width: 400px;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .tf-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .tf-modal-header,
  .tf-modal-body,
  .tf-modal-footer {
    padding: var(--space-4);
  }
  
  .tf-modal-title {
    font-size: var(--font-size-lg);
  }
}

/* ========================================
   22. NAVBAR & NAVIGATION STYLES
   ======================================== */

/* Navbar Base */
.tf-navbar {
  background-color: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-4) var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-fixed);
  box-shadow: var(--shadow-xs);
}

.tf-navbar-content {
  max-width: var(--max-width-container-lg);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tf-navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.tf-navbar-brand-logo {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-accent-primary);
  font-family: var(--font-family-serif);
}

.tf-navbar-brand-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-primary);
}

.tf-navbar-nav {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.tf-navbar-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
}

.tf-navbar-link:hover {
  color: var(--color-accent-primary);
  background-color: var(--color-bg-secondary);
}

/* Dropdown Menu */
.tf-dropdown {
  position: relative;
  display: inline-block;
}

.tf-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-base);
  z-index: var(--z-dropdown);
  margin-top: var(--space-2);
}

.tf-dropdown.tf-dropdown-open .tf-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tf-dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  text-align: left;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: var(--font-size-base);
}

.tf-dropdown-item:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-accent-primary);
}

.tf-dropdown-divider {
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-2) 0;
}

/* User Avatar */
.tf-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
}
