/* CV Analyzer AI — Public Shortcode Styles */

/* ── Container ─────────────────────────────────────────────────────── */
.cva-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    color: #1e293b;
}

/* ── Login notice ───────────────────────────────────────────────────── */
.cva-login-notice {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    text-align: center;
    color: #475569;
}

.cva-login-notice a {
    color: #6366f1;
    font-weight: 600;
}

/* ── Usage Bar ──────────────────────────────────────────────────────── */
.cva-usage-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.cva-usage-bar .cva-remaining {
    font-size: 16px;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.cva-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.cva-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.cva-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Form ───────────────────────────────────────────────────────────── */
#cva-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.cva-field {
    margin-bottom: 20px;
}

.cva-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #334155;
}

.cva-required {
    color: #ef4444;
    margin-left: 2px;
}

.cva-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color .2s;
    font-family: inherit;
    color: #334155;
    box-sizing: border-box;
}

.cva-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* ── Upload Zone ────────────────────────────────────────────────────── */
.cva-upload-zone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.cva-upload-zone:hover,
.cva-upload-zone.cva-drag-over {
    border-color: #6366f1;
    background: #eef2ff;
}

.cva-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.cva-upload-label {
    pointer-events: none;
}

.cva-upload-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.cva-upload-text {
    font-size: 13px;
    color: #64748b;
}

/* ── File List ──────────────────────────────────────────────────────── */
.cva-file-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cva-file-chip {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #4338ca;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cva-file-chip .cva-remove-file {
    cursor: pointer;
    font-size: 14px;
    color: #a5b4fc;
    line-height: 1;
}

.cva-file-chip .cva-remove-file:hover {
    color: #ef4444;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.cva-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    text-decoration: none;
}

.cva-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.cva-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.cva-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.cva-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* ── Spinner ────────────────────────────────────────────────────────── */
.cva-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cva-spin .7s linear infinite;
}

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

/* ── Results ────────────────────────────────────────────────────────── */
#cva-results {
    margin-top: 28px;
    animation: cva-fadeIn .4s ease;
}

@keyframes cva-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cva-results-header h2 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* ── Ranking Table ──────────────────────────────────────────────────── */
.cva-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.cva-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cva-table thead th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.cva-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.cva-table tbody tr:last-child td {
    border-bottom: none;
}

.cva-table tbody tr:nth-child(even) td {
    background: #fafbff;
}

.cva-table tbody tr:first-child td {
    background: #fffbf0;
    font-weight: 600;
}

.cva-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    font-weight: 700;
    font-size: 13px;
    color: #475569;
}

.cva-rank-1 .cva-rank-badge { background: #fef3c7; color: #b45309; }
.cva-rank-2 .cva-rank-badge { background: #e2e8f0; color: #475569; }
.cva-rank-3 .cva-rank-badge { background: #fde8d8; color: #9a3412; }

.cva-score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cva-score-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.cva-score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width .6s ease;
}

.cva-score-val {
    font-weight: 700;
    font-size: 13px;
    min-width: 36px;
    color: #4338ca;
}

/* ── Best Candidate Box ─────────────────────────────────────────────── */
.cva-best-candidate {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-left: 5px solid #0ea5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cva-best-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #0369a1;
    margin-bottom: 6px;
}

.cva-best-name {
    font-size: 22px;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 10px;
}

.cva-explanation {
    font-size: 14px;
    color: #0369a1;
    line-height: 1.6;
}

/* ── Actions ────────────────────────────────────────────────────────── */
.cva-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Warnings ───────────────────────────────────────────────────────── */
#cva-warnings {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #cva-form { padding: 16px; }
    .cva-table thead th,
    .cva-table tbody td { padding: 9px 10px; }
    .cva-score-bar { display: none; }
}

/* ── Individual Evaluation Cards ────────────────────────────────────── */
.cva-section-title {
    margin: 24px 0 12px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.cva-section-title h3 {
    font-size: 17px;
    color: #1e293b;
    margin: 0;
}

.cva-eval-card {
    background: #fafbff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 12px;
    transition: box-shadow .2s;
}

.cva-eval-card:hover {
    box-shadow: 0 3px 12px rgba(99,102,241,.1);
}

.cva-eval-name {
    font-size: 14px;
    font-weight: 700;
    color: #4338ca;
    margin-bottom: 6px;
}

.cva-eval-text {
    font-size: 13px;
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

/* ── Position Name Input ─────────────────────────────────────────────── */
.cva-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    color: #334155;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.cva-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* ── Best Candidate Row — Medium Green Highlight ─────────────────────── */
.cva-table tbody tr.cva-best-row td {
    background: #d1fae5 !important;   /* emerald-100 */
    color: #065f46 !important;         /* emerald-900 */
    font-weight: 700;
}

.cva-table tbody tr.cva-best-row .cva-rank-badge-best {
    background: #34d399;               /* emerald-400 */
    color: #fff;
    font-weight: 800;
}

.cva-table tbody tr.cva-best-row .cva-score-bar-best {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.cva-table tbody tr.cva-best-row .cva-score-val {
    color: #065f46;
}

/* ── Evaluation Bullet Sections ─────────────────────────────────────── */
.cva-eval-section {
    margin-top: 10px;
}

.cva-eval-section-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cva-eval-section-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cva-skill-title {
    color: #1d4ed8;
}
.cva-skill-title::before { background: #1d4ed8; }

.cva-strength-title {
    color: #166534;
}
.cva-strength-title::before { background: #16a34a; }

.cva-gap-title {
    color: #9a3412;
}
.cva-gap-title::before { background: #ea580c; }

.cva-eval-bullets {
    margin: 0 0 0 16px;
    padding: 0;
    list-style: disc;
}

.cva-eval-bullets li {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 3px;
}

/* ── Eval Card — Best Candidate First ───────────────────────────────── */
.cva-eval-card-best {
    border-left-color: #16a34a !important;
    background: #f0fdf4 !important;
}

.cva-eval-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.cva-eval-name {
    font-size: 14px;
    font-weight: 700;
    color: #4338ca;
}

.cva-eval-card-best .cva-eval-name {
    color: #166534;
}

.cva-eval-best-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #86efac;
}

.cva-eval-filename {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    font-weight: 400;
}
