:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --bg-main: #F4F7FA;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    
    --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);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.bg-purple { background-color: #8B5CF6; color: white; }
.bg-red-light { background-color: var(--danger-light); }
.border-red { border: 1px solid #FECACA !important; }
.bg-orange-light { background-color: var(--warning-light); }
.border-orange { border: 1px solid #FDE68A !important; }

/* Navigation */
.top-navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

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

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Container Layout */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px;
}

.view-section {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Upload & Hero Section */
.hero-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 48px;
}

.hero-header h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-header .highlight {
    color: var(--primary);
}

.hero-header p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.card {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.elevated-card {
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
}
.elevated-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.card-title h2 {
    font-size: 20px;
    font-weight: 700;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 300px;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: none;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.dropzone {
    border: 2px dashed #CBD5E1;
    background: #F8FAFC;
    border-radius: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-circle {
    width: 64px;
    height: 64px;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 16px;
}

.dropzone h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.dropzone p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.file-list {
    margin-top: 24px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
}

.file-item button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
.file-item button:hover { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-massive {
    font-size: 18px;
    padding: 16px 48px;
    border-radius: 100px;
}

.action-center {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Dashboard Section */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.dash-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Table */
.full-width-card {
    padding: 0;
    overflow: hidden;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

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

.modern-table th, .modern-table td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.modern-table th {
    background: #F9FAFB;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.modern-table td {
    font-size: 15px;
    vertical-align: middle;
}

.modern-table tbody tr {
    transition: background 0.2s;
}

.modern-table tbody tr:hover {
    background: #F9FAFB;
}

/* UI Elements */
.score-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 13px;
}

.bdg-high { background: #D1FAE5; color: #065F46; }
.bdg-med { background: #FEF3C7; color: #92400E; }
.bdg-low { background: #FEE2E2; color: #991B1B; }

.pill {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin: 2px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.btn-link:hover { text-decoration: underline; }

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.loader-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loader-content {
    text-align: center;
    max-width: 500px;
}

.ai-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 32px;
    animation: spin 1s linear infinite;
}

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

.loader-content h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.loader-content p { color: var(--text-secondary); margin-bottom: 32px; }

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Detailed Candidate Modal (Modernized) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-backdrop.active { display: flex; }

.modal-window {
    background: var(--surface);
    width: 900px;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.avatar-placeholder {
    width: 64px;
    height: 64px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
}

.modal-title-group h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.action-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}
.action-badge.Shortlist { background: #D1FAE5; color: #065F46; }
.action-badge.Reject { background: #FEE2E2; color: #991B1B; }

.icon-btn {
    background: var(--bg-main);
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.icon-btn:hover { background: var(--border); color: var(--text-primary); }

.modal-scroll-area {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Modal Internal Blocks */
.score-overview {
    display: flex;
    gap: 40px;
    align-items: center;
    padding: 32px;
    background: #F8FAFC;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.circular-chart { display: block; width: 120px; position: relative; }
.circular-chart-svg { display: block; max-height: 120px; }
.circle-bg { fill: none; stroke: var(--border); stroke-width: 3.8; }
.circle { fill: none; stroke-width: 3.8; stroke-linecap: round; }
.percentage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px; font-weight: 800;
}

.score-breakdown { flex: 1; }
.score-breakdown h3 { font-size: 18px; margin-bottom: 20px; font-weight: 700; }
.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
}
.bd-item {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.bd-item span { color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }

.ai-insight-box {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0) 100%);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 24px;
    border-radius: 16px;
}

.insight-header {
    font-weight: 700;
    color: var(--primary);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}

.ai-insight-box p { font-size: 16px; line-height: 1.6; }

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.data-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.data-card h4 {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; font-size: 16px; font-weight: 700;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.cloud-tag {
    padding: 6px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px; font-weight: 600;
}
.cloud-tag.success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.cloud-tag.danger { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

.highlight-text { font-size: 16px; font-weight: 600; }
.flag-list { list-style-position: inside; color: var(--danger); font-size: 15px; }
.flag-list li { margin-bottom: 8px; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .split-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-container { padding: 0 20px; }
    .nav-links, .dash-header p { display: none; }
    .score-overview, .two-col-grid { flex-direction: column; grid-template-columns: 1fr; gap: 24px;}
}
