/* ============================================
   RecruitAI - Premium Dark Theme
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #1f2544;
    --bg-glass: rgba(26, 31, 53, 0.7);
    --border: rgba(99, 102, 241, 0.15);
    --border-hover: rgba(99, 102, 241, 0.4);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --gradient-card: linear-gradient(145deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.04));

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);

    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background particles */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.bg-particles::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* =================== HEADER =================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-icon .material-icons-round {
    color: white;
    font-size: 24px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* =================== BUTTONS =================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn .material-icons-round {
    font-size: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    font-weight: 600;
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.upload-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 12px 0 6px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* =================== MAIN =================== */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    position: relative;
    z-index: 1;
}

/* =================== SECTIONS =================== */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.section-header h2 .material-icons-round {
    color: var(--accent-light);
    font-size: 28px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* =================== DROP ZONE =================== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gradient-card);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
    transform: scale(1.005);
}

.drop-zone.drag-over {
    box-shadow: 0 0 40px var(--accent-glow);
}

.drop-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px var(--accent-glow);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 30px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 50px var(--accent-glow), 0 0 80px rgba(99, 102, 241, 0.1);
    }
}

.drop-icon .material-icons-round {
    font-size: 36px;
    color: white;
}

.drop-zone h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.supported-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* =================== FILE LIST =================== */
.file-list {
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.file-list-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-list-header h3 .material-icons-round {
    font-size: 20px;
    color: var(--accent-light);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    gap: 12px;
    transition: var(--transition);
}

.file-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item .material-icons-round {
    color: var(--danger);
    font-size: 28px;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
}

.file-item-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.file-item-remove:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* =================== ACTION BAR =================== */
.action-bar {
    margin-top: 20px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

/* =================== PROCESSING OVERLAY =================== */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.processing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 460px;
    width: 90%;
}

.processing-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 8px;
}

.processing-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0% {
        width: 10%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 10%;
    }
}

/* =================== RESULTS =================== */
.results-section {
    margin-top: 40px;
    animation: slideUp 0.5s ease;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    animation: slideUp 0.5s ease;
}

.result-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.result-card-header {
    padding: 20px 24px;
    background: var(--gradient-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.candidate-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.candidate-info h3 {
    font-size: 17px;
    font-weight: 600;
}

.candidate-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.result-card-body {
    padding: 20px 24px;
}

.detail-group {
    margin-bottom: 16px;
}

.detail-group:last-child {
    margin-bottom: 0;
}

.detail-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

.detail-value.highlight {
    color: var(--success);
}

/* =================== ERRORS =================== */
.errors-panel {
    margin-top: 20px;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    padding: 20px;
}

.errors-panel h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.error-item {
    font-size: 13px;
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.error-item:last-child {
    border-bottom: none;
}

/* =================== TRACKER TABLE =================== */
.tracker-section {
    margin-top: 40px;
    animation: slideUp 0.5s ease;
}

.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.tracker-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.tracker-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-light);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.tracker-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    color: var(--text-secondary);
    white-space: nowrap;
}

.tracker-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.tracker-table tbody tr:hover td {
    color: var(--text-primary);
}

/* =================== TOAST =================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
    min-width: 300px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success .material-icons-round {
    color: var(--success);
}

.toast.error .material-icons-round {
    color: var(--danger);
}

.toast.info .material-icons-round {
    color: var(--accent-light);
}

.toast-text {
    font-size: 14px;
    font-weight: 500;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 12px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .processing-card {
        padding: 32px 24px;
    }

    .drop-zone {
        padding: 40px 20px;
    }
}

/* ---- Multi-Candidate Slot Styles ---- */

.candidate-slot {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.candidate-slot:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.candidate-slot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.candidate-slot-header .material-icons-round {
    color: var(--accent-light);
    font-size: 22px;
}

.candidate-name-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 14px;
    outline: none;
    transition: var(--transition);
}

.candidate-name-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.candidate-drop-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    margin-bottom: 12px;
}

.candidate-drop-zone:hover,
.candidate-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent-light);
}

.candidate-drop-zone .material-icons-round {
    font-size: 24px;
    color: var(--accent);
}

.candidate-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-outline {
    background: transparent;
    border: 2px dashed var(--border);
    color: var(--accent-light);
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1rem;
    transition: var(--transition);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.btn-outline:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}