/* ══════════════════════════════════════════════════════════
   Components — Buttons, Cards, Forms, Modals, etc.
   ══════════════════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-start);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-size-md);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.card-body {
    color: var(--text-secondary);
}

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

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

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-lg);
}

/* ── Tags Input ── */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 42px;
    cursor: text;
}

.tags-container:focus-within {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-start);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    line-height: 1;
}

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

.tag-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    flex: 1;
    min-width: 80px;
    padding: 4px;
    font-size: var(--font-size-sm);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: capitalize;
}

.badge-sourced { background: rgba(139, 92, 246, 0.15); color: var(--stage-sourced); }
.badge-screening { background: rgba(6, 182, 212, 0.15); color: var(--stage-screening); }
.badge-interviewing { background: rgba(59, 130, 246, 0.15); color: var(--stage-interviewing); }
.badge-evaluation { background: rgba(245, 158, 11, 0.15); color: var(--stage-evaluation); }
.badge-offer { background: rgba(34, 197, 94, 0.15); color: var(--stage-offer); }
.badge-onboarding { background: rgba(16, 185, 129, 0.15); color: var(--stage-onboarding); }
.badge-hired { background: rgba(5, 150, 105, 0.15); color: var(--stage-hired); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: var(--stage-rejected); }
.badge-withdrawn { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

.badge-draft { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.badge-open { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.badge-closed { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge-filled { background: rgba(6, 182, 212, 0.15); color: var(--accent-start); }
.badge-sent { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.badge-negotiating { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-accepted { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.badge-declined { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge-scheduled { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.badge-completed { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.badge-cancelled { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn 0.25s ease;
}

.modal-lg {
    max-width: 900px;
}

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

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-color);
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--color-success);
    color: white;
}

.toast-error {
    background: var(--color-danger);
    color: white;
}

.toast-info {
    background: var(--color-info);
    color: white;
}

/* ── Tables ── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(148, 163, 184, 0.04);
}

.data-table .td-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Score Gauge ── */
.score-gauge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    position: relative;
}

.score-gauge.high {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 2px solid var(--color-success);
}

.score-gauge.medium {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 2px solid var(--color-warning);
}

.score-gauge.low {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 2px solid var(--color-danger);
}

/* ── Progress Bar ── */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    transition: width 0.6s ease;
}

/* ── Avatar ── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-xs);
    color: white;
    flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--font-size-md); }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-lg);
}

/* ── Skills Match ── */
.skill-match {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.skill-pill {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.skill-matched {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.skill-missing {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.skill-bonus {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* ── Search Bar ── */
.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

/* ── Section Header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

/* ── Grid ── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* ── Checklist ── */
.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.checklist-item:hover {
    background: rgba(148, 163, 184, 0.04);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.checklist-checkbox.checked {
    background: var(--accent-gradient);
    border-color: transparent;
}

.checklist-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checklist-text {
    flex: 1;
    font-size: var(--font-size-sm);
}

.checklist-text.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

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

.tab.active {
    color: var(--accent-start);
    border-bottom-color: var(--accent-start);
}
