/**
 * Brand Variables - Stress Assessment Tool
 * Reusable design tokens for consistent styling across projects
 *
 * Usage:
 * Import this file in your HTML:
 * <link rel="stylesheet" href="css/brand-variables.css">
 *
 * Or import in another CSS file:
 * @import url('brand-variables.css');
 */

:root {
  /* ============================================ */
  /* BRAND COLORS - Sage & Dark Gray Theme */
  /* ============================================ */

  /* Primary Brand - Sage Green */
  --brand-sage: #9ba3a0;
  --sage-dark: #7a8380;
  --sage-light: #c5cbc9;
  --sage-hover: #b5bbb9;

  /* Background System */
  --bg-dark: rgba(33, 37, 34, 0.95);
  --bg-card: rgba(45, 50, 47, 0.98);
  --bg-card-hover: rgba(55, 60, 57, 0.98);

  /* Status Colors (Sage-tinted) */
  --status-success: #8ba888;
  --status-warning: #a89b88;
  --status-critical: #a88888;

  /* Text Hierarchy */
  --text-primary: #e8eae9;
  --text-secondary: #9ba3a0;
  --text-tertiary: #d1d5db;
  --text-muted: rgba(209, 213, 219, 0.6);

  /* Accent System */
  --accent-sage-red: #a88888;
  --accent-sage-green: #8ba888;

  /* CTA Colors (Purple Gradient) */
  --cta-purple-start: #667eea;
  --cta-purple-end: #764ba2;

  /* Modal/Overlay Colors */
  --overlay-dark: rgba(0, 0, 0, 0.75);
  --overlay-light: rgba(0, 0, 0, 0.5);

  /* Light Theme Colors (for email gate, etc.) */
  --light-bg-gradient-start: #f7fafc;
  --light-bg-gradient-end: #edf2f7;
  --light-border: #e2e8f0;
  --light-text-primary: #1a202c;
  --light-text-secondary: #4a5568;
  --light-text-tertiary: #718096;
  --light-placeholder: #a0aec0;

  /* ============================================ */
  /* LEGACY COLOR SUPPORT (Backwards Compatibility) */
  /* ============================================ */

  --color-primary: var(--brand-sage);
  --color-primary-dark: var(--sage-dark);
  --color-success: var(--status-success);
  --color-warning: var(--status-warning);
  --color-danger: var(--accent-sage-red);
  --color-gray-50: rgba(45, 50, 47, 0.3);
  --color-gray-100: rgba(45, 50, 47, 0.5);
  --color-gray-200: rgba(155, 163, 160, 0.3);
  --color-gray-300: rgba(155, 163, 160, 0.5);
  --color-gray-600: var(--text-tertiary);
  --color-gray-700: var(--text-secondary);
  --color-gray-900: var(--text-primary);

  /* ============================================ */
  /* TYPOGRAPHY */
  /* ============================================ */

  /* Font Families */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Code", "Source Code Pro",
               Consolas, "Courier New", monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2rem;        /* 32px */
  --text-5xl: 2.5rem;      /* 40px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
  --leading-loose: 2;

  /* ============================================ */
  /* SPACING SCALE (8px grid system) */
  /* ============================================ */

  --space-0: 0;
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-7: 1.75rem;      /* 28px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */

  /* ============================================ */
  /* BORDER RADIUS */
  /* ============================================ */

  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;   /* Pills/circles */

  /* ============================================ */
  /* SHADOWS */
  /* ============================================ */

  /* Card Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.4);

  /* Focus Shadows */
  --shadow-focus-sage: 0 0 0 3px rgba(155, 163, 160, 0.2);
  --shadow-focus-purple: 0 0 0 4px rgba(102, 126, 234, 0.1);

  /* Button Shadows */
  --shadow-btn-default: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-btn-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-btn-cta: 0 4px 15px rgba(102, 126, 234, 0.3);
  --shadow-btn-cta-hover: 0 8px 25px rgba(102, 126, 234, 0.4);

  /* ============================================ */
  /* TRANSITIONS */
  /* ============================================ */

  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-bounce: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  /* ============================================ */
  /* BORDERS */
  /* ============================================ */

  --border-width-thin: 1px;
  --border-width-medium: 2px;
  --border-width-thick: 4px;

  /* Border Colors (Dark Theme) */
  --border-default: rgba(155, 163, 160, 0.3);
  --border-hover: var(--brand-sage);
  --border-focus: var(--brand-sage);
  --border-error: var(--accent-sage-red);
  --border-success: var(--accent-sage-green);

  /* Border Colors (Light Theme) */
  --border-light: #e2e8f0;
  --border-light-hover: #cbd5e0;

  /* ============================================ */
  /* Z-INDEX SCALE */
  /* ============================================ */

  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-sticky: 1000;
  --z-modal: 9999;
  --z-tooltip: 10000;

  /* ============================================ */
  /* BREAKPOINTS (for reference in media queries) */
  /* ============================================ */

  /* Note: CSS variables can't be used in media queries,
     but these values are here for documentation */
  --breakpoint-sm: 400px;
  --breakpoint-md: 640px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;

  /* ============================================ */
  /* CONTAINER WIDTHS */
  /* ============================================ */

  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 800px;
  --container-xl: 1140px;
  --container-2xl: 1320px;

  /* ============================================ */
  /* GRADIENTS */
  /* ============================================ */

  /* Purple CTA Gradient */
  --gradient-cta: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Sage Progress Bar Gradient */
  --gradient-progress: linear-gradient(90deg, var(--sage-light), var(--brand-sage));

  /* Light Background Gradient */
  --gradient-light-bg: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);

  /* Success Banner Gradient */
  --gradient-success: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* ============================================ */
  /* BACKDROP FILTERS */
  /* ============================================ */

  --backdrop-blur-sm: blur(4px);
  --backdrop-blur-md: blur(6px);
  --backdrop-blur-lg: blur(8px);
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-sage { color: var(--brand-sage); }
.text-error { color: var(--accent-sage-red); }
.text-success { color: var(--accent-sage-green); }

/* Background Colors */
.bg-dark { background: var(--bg-dark); }
.bg-card { background: var(--bg-card); }
.bg-sage { background: var(--brand-sage); }
.bg-error { background: rgba(168, 136, 136, 0.15); }
.bg-success { background: rgba(139, 168, 136, 0.15); }

/* Font Weights */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Text Sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Transitions */
.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }
.transition-bounce { transition: all var(--transition-bounce); }

/* ============================================ */
/* TRIAGE SYSTEM STYLES */
/* ============================================ */

.triage-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.triage-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.triage-content p {
    margin: 0.5rem 0 1rem 0;
    opacity: 0.95;
    font-size: 1rem;
    line-height: 1.6;
}

.tier-progress {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.2);
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tier-indicator {
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    min-width: 50px;
}

.progress-section {
    background: linear-gradient(135deg, #f6f8fb 0%, #e9f0f8 100%);
    border-left: 4px solid var(--brand-sage);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.progress-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-card {
    background: white;
    padding: 1.25rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
    color: var(--text-primary);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Exception badges */
.exception-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Protocol warning styles */
.protocol-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.protocol-warning.optimal {
    background: #d1fae5;
    border-left: 3px solid #10b981;
}

.protocol-warning.caution {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.protocol-warning.warning {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
}

.protocol-warning strong {
    font-weight: 600;
}

/* Show All Button Styles */
.show-all-container {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px dashed #cbd5e0;
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.secondary-btn:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.secondary-btn:active {
    transform: scale(0.98);
}

.helper-text {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* All Protocols Section */
.all-protocols-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.all-protocols-section h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.protocol-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* All Protocols View Styles */
.protocol-card-all-view {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.protocol-card-all-view:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.protocol-header-all {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.protocol-title-all {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    flex: 1;
    min-width: 200px;
}

.protocol-tier-badge {
    display: inline-block;
    background: #f0f4f8;
    color: #2d3748;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.protocol-grade-badge {
    display: inline-block;
    background: #e6f2ff;
    color: #2563eb;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.protocol-description-all {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.protocol-meta-all {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.protocol-accessibility,
.protocol-category {
    font-size: 0.85rem;
    color: #718096;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.protocol-select-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.protocol-select-btn:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.protocol-select-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .triage-banner {
        padding: 1.5rem;
    }

    .triage-content h3 {
        font-size: 1.25rem;
    }

    .tier-indicator {
        font-size: 0.75rem;
    }

    .progress-section {
        padding: 1rem;
    }

    .show-all-container {
        margin: 1.5rem 0;
        padding: 1.5rem;
    }

    .secondary-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .all-protocols-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .all-protocols-section h2 {
        font-size: 1.5rem;
    }

    .protocol-card-all-view {
        padding: 1rem;
    }

    .protocol-header-all {
        flex-direction: column;
    }

    .protocol-title-all {
        font-size: 1rem;
    }

    .protocol-tier-badge,
    .protocol-grade-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .protocol-select-btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}
