/* ========================================
   LIFE & AFTER - BRAND THEME
   Official Brand Guidelines Implementation
   ======================================== */

:root {
    /* ========================================
       BRAND COLORS
       ======================================== */

    /* Main Colors */
    --brand-dark: #141413;
    --brand-light: #faf9f5;
    --brand-mid-gray: #b0aea5;
    --brand-light-gray: #e8e6dc;

    /* Accent Colors */
    --brand-green: #295763;
    --brand-green-dark: #1f4751;
    --brand-gold: #E6CF97;
    --brand-mauve: #333340;

    /* Surface Colors - Hierarchy */
    --surface-primary: #FFF5EC;      /* Main background */
    --surface-secondary: #F7F0E6;    /* Dashboard/form backgrounds */
    --surface-tertiary: #EFE7D9;     /* Tiles and panel backgrounds */

    /* ========================================
       TYPOGRAPHY
       ======================================== */

    /* Font Families */
    --font-title: 'Tropikal', Arial, sans-serif;
    --font-heading: 'Poppins', Arial, sans-serif;
    --font-body: 'Poppins', Georgia, sans-serif;
    --font-form: 'Inter', -apple-system, sans-serif;

    /* Font Sizes - Hierarchy */
    --font-size-title: 2.5rem;       /* 40px - Page titles */
    --font-size-h1: 2rem;            /* 32px - Section headings */
    --font-size-h2: 1.5rem;          /* 24px - Subsection headings */
    --font-size-h3: 1.25rem;         /* 20px - Card headings */
    --font-size-h4: 1.125rem;        /* 18px - Small headings */
    --font-size-body: 1rem;          /* 16px - Body text */
    --font-size-small: 0.875rem;     /* 14px - Small text */
    --font-size-xs: 0.75rem;         /* 12px - Labels, captions */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    --line-height-loose: 1.8;

    /* ========================================
       SPACING SYSTEM
       ======================================== */

    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */

    /* ========================================
       BORDER RADIUS
       All panels use 16px as per brand guidelines
       ======================================== */

    --radius-sm: 4px;       /* Small elements (badges, tags) */
    --radius-md: 8px;       /* Buttons, inputs */
    --radius-lg: 12px;      /* Cards (non-primary) */
    --radius-xl: 16px;      /* Primary panels and cards */
    --radius-round: 50%;    /* Avatars, circular elements */

    /* ========================================
       SHADOWS
       ======================================== */

    --shadow-sm: 0 1px 3px rgba(20, 20, 19, 0.06), 0 1px 2px rgba(20, 20, 19, 0.04);
    --shadow-md: 0 4px 6px rgba(20, 20, 19, 0.05), 0 2px 4px rgba(20, 20, 19, 0.04);
    --shadow-lg: 0 10px 25px rgba(20, 20, 19, 0.08), 0 4px 10px rgba(20, 20, 19, 0.05);
    --shadow-xl: 0 20px 40px rgba(20, 20, 19, 0.1), 0 8px 16px rgba(20, 20, 19, 0.06);

    /* ========================================
       TRANSITIONS
       ======================================== */

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* ========================================
       SEMANTIC COLORS
       ======================================== */

    /* Status Colors */
    --status-online: var(--brand-green);
    --status-away: #c4a060;
    --status-offline: var(--brand-mid-gray);
    --status-danger: #b4847a;
    --status-success: var(--brand-green);
    --status-warning: var(--brand-gold);

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;

    /* Border Colors */
    --border-light: #E8E4DD;

    /* Interactive States */
    --color-hover: rgba(41, 87, 99, 0.08);
    --color-active: rgba(41, 87, 99, 0.12);
    --color-focus: var(--brand-green);
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--brand-dark);
    background: var(--surface-primary);
}

/* ========================================
   TYPOGRAPHY UTILITIES
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--brand-dark);
}

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

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

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

h4 {
    font-size: var(--font-size-h4);
}

p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
}

small {
    font-size: var(--font-size-small);
}

/* Title Style (for page headers) */
.page-title {
    font-family: var(--font-title);
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-bold);
}

/* Form Elements */
label,
input,
select,
textarea,
button.btn-form {
    font-family: var(--font-form);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

.panel,
.card,
.tile {
    background: var(--surface-tertiary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.panel-secondary {
    background: var(--surface-secondary);
}

.panel-light {
    background: var(--brand-light);
}

/* ========================================
   REUSABLE COMPONENT CLASSES
   For future dashboards
   ======================================== */

.brand-card {
    background: var(--surface-tertiary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--brand-light-gray);
}

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

.brand-panel {
    background: var(--brand-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--brand-light-gray);
}

.brand-section {
    background: var(--surface-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
}

/* ========================================
   BUTTON STYLES
   ======================================== */

.btn-primary {
    background: var(--brand-green);
    color: var(--brand-light);
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-form);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-primary:hover {
    background: var(--brand-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--brand-dark);
    border: 1px solid var(--brand-light-gray);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-family: var(--font-form);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--color-hover);
    border-color: var(--brand-mid-gray);
}

/* ========================================
   FORM STYLES
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--brand-light-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-form);
    font-size: var(--font-size-body);
    color: var(--brand-dark);
    background: var(--brand-light);
    transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(41, 87, 99, 0.1);
}

label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--brand-dark);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-primary {
    color: var(--brand-dark);
}

.text-secondary {
    color: var(--brand-mid-gray);
}

.text-accent {
    color: var(--brand-green);
}

.bg-primary {
    background: var(--surface-primary);
}

.bg-secondary {
    background: var(--surface-secondary);
}

.bg-tertiary {
    background: var(--surface-tertiary);
}

/* Spacing utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ========================================
   DARK MODE THEME
   ======================================== */

[data-theme="dark"] {
    /* Main Colors */
    --brand-dark: #F5F4F0;
    --brand-light: #1a1a1f;
    --brand-mid-gray: #8a8880;
    --brand-light-gray: #3a3a42;

    /* Accent Colors - Keep similar but adjust for dark bg */
    --brand-green: #4a9aaa;
    --brand-green-dark: #3a8090;
    --brand-gold: #D4B870;
    --brand-mauve: #9090a0;

    /* Surface Colors - Dark variants */
    --surface-primary: #121215;
    --surface-secondary: #1a1a1f;
    --surface-tertiary: #252530;

    /* Semantic Colors */
    --status-online: #4a9aaa;
    --status-away: #c4a060;
    --status-offline: #6a6a70;
    --status-danger: #c08080;
    --status-success: #4a9aaa;
    --status-warning: #D4B870;

    /* Text Colors */
    --text-primary: #F5F4F0;
    --text-secondary: #a0a0a8;
    --text-tertiary: #707078;

    /* Border Colors */
    --border-light: #3a3a42;

    /* Interactive States */
    --color-hover: rgba(74, 154, 170, 0.15);
    --color-active: rgba(74, 154, 170, 0.25);
    --color-focus: #4a9aaa;

    /* Shadows - More prominent for dark mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.25);
}

/* Dark mode body background */
[data-theme="dark"] body {
    background: var(--surface-primary);
    color: var(--brand-dark);
}
