:root {
    --primary-blue: #00ccff;
    --primary-blue-dark: #0066cc;
    --accent-green: #00ff88;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --labora-gradient: linear-gradient(135deg, #00ccff 0%, #0066cc 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 168, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: white;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Main Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar / Editor */
.editor-sidebar {
    width: 40%;
    min-width: 450px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.editor-content::-webkit-scrollbar {
    width: 6px;
}

.editor-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Preview Area */
.preview-area {
    flex: 1;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

/* Iframe Resume */
.resume-frame {
    width: 210mm;
    height: 297mm;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: none;
    transform-origin: top center;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

/* Top Navigation / Header */
.app-header {
    height: 64px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    backdrop-filter: blur(10px);
}

.logo-small {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--labora-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Labora Score Widget */
.score-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
}

.score-circle {
    position: relative;
    width: 40px;
    height: 40px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-circle circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.score-circle .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.score-circle .progress {
    stroke: var(--primary-blue);
    stroke-dasharray: 100.48;
    /* Exact circum for r=16 */
    stroke-dashoffset: 100.48;
    transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Score Panel */
.score-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 250px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.score-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.score-panel h4 {
    font-size: 0.8rem;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-panel ul {
    list-style: none;
    padding: 0;
}

.score-panel li {
    font-size: 0.75rem;
    color: var(--slate-300);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-panel li i {
    font-size: 0.6rem;
    color: var(--primary-blue);
}

.score-widget {
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.score-widget:hover {
    background: var(--glass-hover);
}

/* Perfect State Animation */
.score-widget.perfect {
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.score-widget.perfect .score-value {
    color: var(--accent-green);
}

/* Color Dots */
.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-dot:hover {
    transform: scale(1.2);
}

.color-dot.active {
    border-color: white;
    transform: scale(1.1);
}

/* Labora Score Widget Updates */
#score-recommendations {
    margin-top: 10px;
}

.recommendation-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid var(--primary-blue);
}

.recommendation-item i {
    color: var(--warning-orange);
}

/* --- JOB OFFER INPUT COMPONENT --- */
.job-input-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.job-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.job-input-header h3 {
    font-size: 1.1rem;
    color: var(--text-white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-input-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
}

.job-tab {
    background: transparent;
    border: none;
    color: var(--text-gray);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-tab:hover {
    color: var(--text-white);
}

.job-tab.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-panel {
    display: none;
}

.input-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Panel: Link */
.input-group {
    display: flex;
    gap: 10px;
}

.modern-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
}

.btn-primary-sm {
    background: var(--primary-blue);
    color: black;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary-sm:hover {
    transform: translateY(-2px);
}

/* Panel: Text */
.modern-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 10px;
    font-family: inherit;
}

.full-width {
    width: 100%;
}

/* Panel: Image */
.image-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-gray);
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--primary-blue);
    background: rgba(0, 168, 255, 0.05);
    color: var(--text-white);
}

.image-upload-area i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

/* Loading & Result */
.job-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: var(--primary-blue);
    gap: 10px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 168, 255, 0.3);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.job-result {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.job-result-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.job-badge {
    color: var(--success-green);
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-text-sm {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.res-company {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Helper */
.input-hint {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-top: 5px;
}

/* Tab Switcher */
.tab-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--slate-400);
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.tab-btn.active {
    background: var(--glass-hover);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Form Styling */
.section-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.section-card:focus-within {
    border-color: rgba(0, 204, 255, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-300);
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: rgba(0, 0, 0, 0.5);
}

select option {
    background: #1e293b;
    color: white;
}

/* AI Magic Button */
.ai-magic-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}

.ai-magic-btn:hover {
    transform: scale(1.05);
}

.ai-magic-btn i {
    font-size: 0.8rem;
}

/* Dynamic Items */
.dynamic-item {
    border-left: 2px solid var(--glass-border);
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.remove-btn {
    position: absolute;
    right: 0;
    top: 0;
    color: var(--slate-600);
    cursor: pointer;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #ef4444;
}

.add-btn {
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.add-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(0, 204, 255, 0.05);
}

/* Privacy Badge */
.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--slate-500);
    margin-top: 2rem;
    justify-content: center;
}

/* Actions Bottom Bar */
.editor-actions {
    padding: 1.25rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 1rem;
}

/* Action Buttons */
.btn-main {
    flex: 1;
    background: var(--labora-gradient);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 204, 255, 0.3);
    transition: all 0.2s;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--glass-hover);
}

/* Template Cards */
.template-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    border-color: var(--primary-blue);
    background: var(--glass-hover);
}

.template-card.active {
    border-color: var(--primary-blue);
    background: rgba(0, 204, 255, 0.1);
    box-shadow: 0 0 0 1px var(--primary-blue);
}

.template-thumb {
    height: 80px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.template-preview-mini {
    width: 100%;
    height: 100%;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    border-radius: 2px;
}

.template-preview-mini::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: #e2e8f0;
}

.template-preview-mini::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 10px;
    right: 30px;
    height: 2px;
    background: #f1f5f9;
}

.template-preview-mini.premium {
    background: white;
    display: flex;
}

.template-preview-mini.premium::before {
    content: '';
    width: 30%;
    height: 100%;
    background: #1e293b;
    position: absolute;
    left: 0;
    top: 0;
}

.template-preview-mini.premium::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 35%;
    right: 10px;
    height: 3px;
    background: #e2e8f0;
    box-shadow: 0 6px 0 #f1f5f9, 0 12px 0 #f1f5f9;
}


.template-info {
    padding: 8px;
}

.template-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.template-desc {
    font-size: 0.65rem;
    color: var(--slate-500);
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-sidebar {
        width: 100%;
        min-width: unset;
    }

    .preview-area {
        display: none;
    }
}