/**
 * Allyvo Design System
 * Primary Color: #6366f1 (Indigo)
 * WCAG 2.1 AA Compliant
 * Mobile-First Responsive Design
 */

/* ============================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   ============================================ */

:root {
    /* Primary Indigo Color Scheme */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #eef2ff;
    --color-primary-muted: #a5b4fc;

    /* Status Colors (WCAG AA Compliant) */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #06B6D4;

    /* Job Status Colors with Pattern Support */
    --color-status-new: #6366f1;
    --color-status-new-bg: #eef2ff;
    --color-status-applied: #3B82F6;
    --color-status-applied-bg: #DBEAFE;
    --color-status-interviewing: #F59E0B;
    --color-status-interviewing-bg: #FEF3C7;
    --color-status-offer: #10B981;
    --color-status-offer-bg: #D1FAE5;
    --color-status-rejected: #EF4444;
    --color-status-rejected-bg: #FEE2E2;
    --color-status-withdrawn: #6B7280;
    --color-status-withdrawn-bg: #F3F4F6;

    /* Neutral Colors */
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-border: #E5E7EB;
    --color-background: #F9FAFB;
    --color-surface: #FFFFFF;

    /* Typography */
    --font-family-primary: Inter, system-ui, -apple-system, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */

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

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

    /* Border Radius */
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-full: 9999px;

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

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-standard: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   Mobile-First Approach
   ============================================ */

/* Base styles: Mobile (320px - 767px) */
/* No media query needed - mobile first */

/* Tablet: 768px and up */
@media (min-width: 768px) {
    :root {
        --container-padding: 1.5rem;
    }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
    :root {
        --container-padding: 2rem;
    }
}

/* Large Desktop: 1280px and up */
@media (min-width: 1280px) {
    :root {
        --container-padding: 2rem;
    }
}

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

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

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-standard);
    text-decoration: none;
    font-family: inherit;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-surface);
    padding: 0.5rem 1rem;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-background);
}

.btn-secondary:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Destructive Button */
.btn-destructive {
    background-color: var(--color-error);
    color: var(--color-surface);
    padding: 0.5rem 1rem;
}

.btn-destructive:hover:not(:disabled) {
    background-color: #DC2626;
}

.btn-destructive:focus {
    box-shadow: 0 0 0 2px var(--color-error);
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
}

.btn-md {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-base);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-lg);
}

/* ============================================
   FORM COMPONENTS
   ============================================ */

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-standard);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input-error,
.form-select-error,
.form-textarea-error {
    border-color: var(--color-error);
}

.form-input-error:focus,
.form-select-error:focus,
.form-textarea-error:focus {
    box-shadow: 0 0 0 2px var(--color-error);
}

.form-help {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

.form-error {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-error);
    margin-top: var(--spacing-xs);
}

/* ============================================
   CARD AND PANEL SYSTEM
   ============================================ */

.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.card-body {
    padding: 1rem 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-background);
}

/* Job Card Specific */
.job-card {
    cursor: pointer;
    transition: all var(--transition-standard);
}

.job-card:hover {
    box-shadow: var(--shadow-md);
}

.job-card-selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* Job Card Computing Overlay */
.job-card-computing-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(238, 242, 255, 0.85);
    border-radius: inherit;
    z-index: 10;
    backdrop-filter: blur(2px);
    animation: overlay-fade-in 0.2s ease-out;
}

@keyframes overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shimmer bar that sweeps across the bottom of the card */
.job-card-computing-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 40%;
    border-radius: 0 0 inherit inherit;
    background: linear-gradient(90deg, var(--color-primary, #4f46e5), #7c3aed);
    animation: shimmer-sweep 1.4s ease-in-out infinite;
}

@keyframes shimmer-sweep {
    0%   { left: 0;   width: 30%; }
    50%  { left: 35%;  width: 40%; }
    100% { left: 70%;  width: 30%; }
}

@media (prefers-reduced-motion: reduce) {
    .job-card-computing-overlay {
        animation: none;
    }
    .job-card-computing-overlay::after {
        animation: none;
        width: 100%;
        left: 0;
    }
}

/* ============================================
   STATUS INDICATORS AND BADGES
   Color-blind Accessible with Patterns
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* Status Badge Variants with Pattern Prefixes */
.status-new {
    background-color: var(--color-status-new-bg);
    color: var(--color-status-new);
}

.status-new::before {
    content: "● ";
    margin-right: 0.25rem;
}

.status-applied {
    background-color: var(--color-status-applied-bg);
    color: var(--color-status-applied);
}

.status-applied::before {
    content: "⟋ ";
    margin-right: 0.25rem;
}

.status-interviewing {
    background-color: var(--color-status-interviewing-bg);
    color: var(--color-status-interviewing);
}

.status-interviewing::before {
    content: "~ ";
    margin-right: 0.25rem;
}

.status-offer {
    background-color: var(--color-status-offer-bg);
    color: var(--color-status-offer);
}

.status-offer::before {
    content: "✓ ";
    margin-right: 0.25rem;
}

.status-rejected {
    background-color: var(--color-status-rejected-bg);
    color: var(--color-status-rejected);
}

.status-rejected::before {
    content: "✗ ";
    margin-right: 0.25rem;
}

.status-withdrawn {
    background-color: var(--color-status-withdrawn-bg);
    color: var(--color-status-withdrawn);
}

.status-withdrawn::before {
    content: "– ";
    margin-right: 0.25rem;
}

/* Match Score Indicators */
.match-score {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.match-score-high {
    background-color: var(--color-status-offer-bg);
    color: var(--color-status-offer);
}

.match-score-medium {
    background-color: var(--color-status-interviewing-bg);
    color: var(--color-status-interviewing);
}

.match-score-low {
    background-color: var(--color-status-rejected-bg);
    color: var(--color-status-rejected);
}

/* ============================================
   ACCESSIBILITY UTILITIES
   ============================================ */

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-surface);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: var(--z-tooltip);
}

.skip-link:focus {
    top: 0;
}

/* Focus Visible (for keyboard navigation) */
.focus-visible:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   LOADING AND ANIMATION STATES
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--color-border) 25%,
        var(--color-background) 50%,
        var(--color-border) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Transition Utilities */
.transition-fast {
    transition: all var(--transition-fast);
}

.transition-standard {
    transition: all var(--transition-standard);
}

.transition-slow {
    transition: all var(--transition-slow);
}

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

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Hide on mobile */
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
}

/* Hide on tablet and up */
.hidden-tablet-up {
    display: block;
}

@media (min-width: 768px) {
    .hidden-tablet-up {
        display: none;
    }
}

/* Hide on desktop and up */
.hidden-desktop-up {
    display: block;
}

@media (min-width: 1024px) {
    .hidden-desktop-up {
        display: none;
    }
}

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

/* Hero heading — tight tracking and leading for large display text */
.heading-hero {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* ============================================
   TOUCH TARGET ACCESSIBILITY
   Minimum 44x44px for iOS, 48x48px for Android
   ============================================ */

.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .touch-target {
        min-width: 48px;
        min-height: 48px;
    }
}



