/**
 * Components Entry File - Prime Factors Pro
 * 
 * This file imports all component CSS modules and provides fallback defaults
 * for graceful degradation if design-tokens.css fails to load.
 *
 * CSS Fallback Strategy (Requirement 13.5):
 * This file declares all design token custom properties with their default
 * values directly on :root. This ensures that if design-tokens.css fails to
 * load (network error, blocked resource, etc.), all var() references in the
 * component files still resolve to valid values — components render with
 * correct styling and no content is hidden or displaced.
 *
 * Load order in HTML: design-tokens.css → components.css (this file).
 * When both load, both define the same :root properties with identical values,
 * so the last declaration wins harmlessly. When design-tokens.css is absent,
 * the :root block below provides the complete token set as a fallback.
 *
 * Requirements: 13.5
 */

/* ==========================================================================
   Fallback Defaults
   These mirror design-tokens.css values and serve as a safety net.
   When design-tokens.css loads normally, its declarations take precedence
   (same specificity, earlier source order). If it fails to load, these
   ensure all custom properties resolve to valid values.
   ========================================================================== */

:root {
    /* Brand Colors */
    --color-primary: #1B2B4B;
    --color-primary-light: #2D4A7A;
    --color-secondary: #C9A84C;
    --color-secondary-light: #E5C76B;
    --color-accent: #0EA5E9;

    /* Semantic Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;

    /* Neutrals */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F8FAFC;
    --color-bg-tertiary: #F1F5F9;
    --color-bg-dark: #0F172A;
    --color-text-primary: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-muted: #94A3B8;
    --color-border: #E2E8F0;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Courier New', monospace;
    --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;
    --font-size-5xl: 3rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-xs: 1rem;
    --line-height-sm: 1.25rem;
    --line-height-base: 1.5rem;
    --line-height-lg: 1.75rem;
    --line-height-xl: 1.75rem;
    --line-height-2xl: 2rem;
    --line-height-3xl: 2.25rem;
    --line-height-4xl: 2.5rem;
    --line-height-5xl: 1;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --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: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==========================================================================
   Icon System Base Styles (Requirement 13.1)
   Ensures icon elements reserve their dimensions even if Lucide fails to load.
   Text labels adjacent to icons remain visible and clickable.
   ========================================================================== */

.icon-pfp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    /* Default sizing (matches --md) */
    width: 20px;
    height: 20px;
}

.icon-pfp--sm { width: 16px; height: 16px; }
.icon-pfp--md { width: 20px; height: 20px; }
.icon-pfp--lg { width: 24px; height: 24px; }
.icon-pfp--xl { width: 32px; height: 32px; }

/* ==========================================================================
   Notification Component (Requirement 13.4)
   Dismissible notification banners for error/warning/info states.
   ========================================================================== */

.notification-pfp {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3, 0.75rem);
    padding: var(--space-4, 1rem) var(--space-6, 1.5rem);
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid var(--color-border, #E2E8F0);
    background: var(--color-bg-secondary, #F8FAFC);
    font-family: var(--font-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: var(--line-height-sm, 1.25rem);
    color: var(--color-text-primary, #1E293B);
    margin-bottom: var(--space-4, 1rem);
}

.notification-pfp--warning {
    border-color: var(--color-warning, #F59E0B);
    background: #FFFBEB;
    color: #92400E;
}

.notification-pfp--danger {
    border-color: var(--color-danger, #EF4444);
    background: #FEF2F2;
    color: #991B1B;
}

.notification-pfp--info {
    border-color: var(--color-info, #3B82F6);
    background: #EFF6FF;
    color: #1E40AF;
}

.notification-pfp--success {
    border-color: var(--color-success, #10B981);
    background: #ECFDF5;
    color: #065F46;
}

.notification-pfp__message {
    flex: 1;
}

.notification-pfp__dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1, 0.25rem);
    color: inherit;
    opacity: 0.6;
    border-radius: var(--radius-sm, 0.375rem);
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast, 150ms ease);
}

.notification-pfp__dismiss:hover {
    opacity: 1;
}

/* ==========================================================================
   Component Imports — Individual files are loaded directly via <link> tags
   in buildPageHead() to avoid @import ordering issues.
   ========================================================================== */
