:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --border: #334155;
    --error: #ef4444;
    --success: #22c55e;
    --accent-color: #38bdf8;
    --bg-darker: #020617;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.panel-header {
    background-color: #0f172a80;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.content-area {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    position: relative;
}

#pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

#json-viewer {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #e2e8f0;
}

.drop-zone {
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background-color: #38bdf80a;
    color: var(--text-primary);
}

.btn {
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

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

.btn-small {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: #38bdf81a;
}


.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

pre {
    background: #020617;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    position: relative;
    overflow: visible;
}

/* JSON Tree Formatting */
.json-tree {
    list-style: none;
    padding-left: 1.5rem;
    border-left: 1px solid #334155a0;
}

.json-tree:first-child {
    padding-left: 0;
    border-left: none;
}

.json-node {
    position: relative;
    padding: 1px 0;
}

.caret {
    position: absolute;
    left: -1.2rem;
    top: 5px;
    cursor: pointer;
    width: 0.8rem;
    height: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    user-select: none;
}

.caret::before {
    content: "▾";
    font-size: 1rem;
    color: var(--text-secondary);
}

.caret:hover::before {
    color: var(--accent);
}

.collapsed .caret {
    transform: rotate(-90deg);
}

.collapsed .json-tree {
    display: none;
}

.collapsed::after {
    content: " ... }";
    color: var(--text-secondary);
    font-size: 0.8rem;
    background: #2dd4bf20;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.collapsed.array::after {
    content: " ... ]";
}

.json-node:hover {
    background: #ffffff05;
}

.string {
    color: #facc15;
}

.number {
    color: #f87171;
}

.boolean {
    color: #60a5fa;
}

.null {
    color: #94a3b8;
}

.key {
    color: #818cf8;
    font-weight: 500;
}

/* ATS Section Styles */
.input-field {
    width: 100%;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    margin-top: 5px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--accent);
}

label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ats-card {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.ats-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.progress-bar {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 1s ease-out;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pass {
    background: #064e3b;
    color: #34d399;
}

.badge-reject {
    background: #7f1d1d;
    color: #f87171;
}

.feedback-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.feedback-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 3px;
    background: #334155;
    border: 1px solid var(--border);
}

/* Universal Career Intelligence v5 Additions */
.profile-card {
    background: #0f172a80;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.domain-card {
    background: #1e293b40;
    border: 1px solid var(--border);
    border-top: 4px solid #4a5568;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease;
}

.domain-card:hover {
    transform: translateY(-2px);
    background: #1e293b80;
}

.evidence-chip {
    display: inline-block;
    padding: 2px 8px;
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 2px;
}

.metric-grid {
    display: flex;
    gap: 10px;
}

.metric-box {
    background: #0f172a;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
}

.metric-val {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
}

.metric-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

.risk-alert {
    background: #7f1d1d20;
    border: 1px solid #7f1d1d;
    color: #fca5a5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.risk-alert ul {
    margin-top: 8px;
    color: #f87171;
}

/* Custom Scrollbar for modern look */
.content-area::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #475569;
}