/* ==========================================
   HireStrike Component Library Styles
   Design System: Blue Primary (#2563eb)
   Typography: Plus Jakarta Sans
   ========================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #67E8F9;
    --primary-bg: #ECFEFF;
    
    --success: #059669;
    --success-light: #D1FAE5;
    
    --warning: #D97706;
    --warning-light: #FEF3C7;
    
    --error: #DC2626;
    --error-light: #FEE2E2;
    
    --info: #2563eb;
    --info-light: #eff6ff;
    
    --text-primary: #1C1917;
    --text-secondary: #44403C;
    --text-tertiary: #78716C;
    --text-muted: #A8A29E;
    --text-inverse: #FFFFFF;
    
    --bg-primary: #FAFAF9;
    --bg-secondary: #F5F5F4;
    --bg-elevated: #FFFFFF;
    
    --border-light: #E2E8F0;
    
    --shadow-sm: 0 2px 4px rgba(26, 26, 26, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.08);
    --shadow-lg: 0 8px 24px rgba(26, 26, 26, 0.10);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --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;
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
}

/* ========== BUTTONS ========== */

.btn {
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* Primary */
.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

/* Secondary */
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

/* Tertiary */
.btn-tertiary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

/* Danger */
.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #B91C1C;
    box-shadow: var(--shadow-md);
}

/* Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-icon {
    display: inline-flex;
}

/* ========== BADGES ========== */

.badge {
    display: inline-block;
    padding: var(--space-2) var(--space-3);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active {
    background: var(--success-light);
    color: var(--success);
}

.badge-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-inactive {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-completed {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.badge-paused {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-default {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* ========== CARDS ========== */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-hover {
    transition: all var(--transition-fast);
}

.card-hover:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.card-icon {
    font-size: 1.5rem;
}

.card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* ========== PROGRESS BARS ========== */

.progress-container {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    font-size: 0.875rem;
}

.progress-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-value {
    color: var(--text-tertiary);
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 600ms ease;
}

/* ========== STAT CARDS ========== */

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
    display: block;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-trend.trend-positive {
    color: var(--success);
}

.stat-trend.trend-negative {
    color: var(--error);
}

/* ========== TABLES ========== */

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

.action-btn {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* ========== EMPTY STATES ========== */

.empty-state {
    text-align: center;
    padding: var(--space-12);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-6);
}

.empty-state-title {
    margin: 0 0 var(--space-3) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.empty-state-description {
    margin: 0 0 var(--space-6) 0;
    color: var(--text-secondary);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== FORMS ========== */

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

.form-label {
    display: block;
    margin-bottom: var(--space-3);
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.required {
    color: var(--error);
    margin-left: var(--space-1);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-input:disabled,
.form-select:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ========== MODALS ========== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
}

/* ========== NAVIGATION ========== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.breadcrumb-sep {
    color: var(--text-tertiary);
}

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

.nav-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-label {
    font-size: 0.9375rem;
}

/* ========== ALERTS ========== */

.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.alert-info {
    background: var(--info-light);
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-error {
    background: var(--error-light);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-content {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: inherit;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 0.7;
}

/* ========== CHIPS & TAGS ========== */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-secondary);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 1rem;
    padding: 0;
    display: inline-flex;
    transition: opacity var(--transition-fast);
}

.chip-remove:hover {
    opacity: 0.7;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-default {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tag-primary {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.tag-success {
    background: var(--success-light);
    color: var(--success);
}

.tag-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.tag-error {
    background: var(--error-light);
    color: var(--error);
}

.tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 0.875rem;
    padding: 0;
    display: inline-flex;
    transition: opacity var(--transition-fast);
}

.tag-remove:hover {
    opacity: 0.7;
}

/* ========== FILTER GROUPS ========== */

.filter-group {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.filter-title {
    margin: 0 0 var(--space-4) 0;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

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

.filter-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.filter-item input[type="checkbox"] {
    cursor: pointer;
}

/* ========== RESPONSIVE TABLES ========== */

/* Shared utility — wrap any wide <table> in a .table-responsive div.
   Horizontal scroll on overflow with iOS momentum; sticky header during
   page scroll; tighter padding on phones. Apply .table-cards on the
   <table> itself for the card-stack treatment on phones (see below). */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > table {
    width: 100%;
    border-collapse: collapse;
}

.table-responsive > table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-secondary, #F5F5F4);
}

@media (max-width: 480px) {
    .table-responsive > table th,
    .table-responsive > table td {
        padding: var(--space-2) var(--space-3);
        font-size: 0.8125rem;
    }
}

/* Card-stack: on phones, each <tr> becomes a vertical card with
   data-label values shown as left-aligned key / right-aligned value.
   Each <td> in the table MUST have data-label="Column Name". */
@media (max-width: 640px) {
    .table-cards thead {
        display: none;
    }
    .table-cards tbody tr {
        display: block;
        margin-bottom: var(--space-3);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: var(--space-3);
        background: var(--bg-elevated);
        box-shadow: var(--shadow-sm);
    }
    .table-cards tbody tr:hover {
        background: var(--bg-elevated);
    }
    .table-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-2) 0;
        border-bottom: 1px dashed var(--border-light);
        text-align: right;
        font-size: 0.875rem;
    }
    .table-cards tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .table-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: left;
        flex-shrink: 0;
    }
    /* Empty-state row with colspan should stay full-width */
    .table-cards tbody td[colspan] {
        display: block;
        text-align: center;
    }
    .table-cards tbody td[colspan]::before {
        content: none;
    }
}

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

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }

    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
