/*
 * ChangeFluent AI Tools - CV Refresh
 *
 * Two views share this stylesheet:
 *   1. Landing / upload form + history list
 *   2. Review layout (document + margin panel with annotations)
 *
 * Highlight severities use hue-only distinctions with sufficient contrast
 * for accessibility. Status modifiers dim resolved highlights so the
 * user's attention stays on open items.
 */

/* ---------- Landing / form ---------- */

.cfait-form-section {
    padding: 40px 0 80px;
}
.cfait-cv-form {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 12px;
    padding: 32px;
}
.cfait-field {
    margin-bottom: 20px;
}
.cfait-field label {
    display: block;
    font-weight: 600;
    color: #0e2238;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.cfait-field input[type="text"],
.cfait-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: #0e2238;
    box-sizing: border-box;
}
.cfait-field input[type="text"]:focus,
.cfait-field textarea:focus {
    outline: none;
    border-color: #0082ba;
    box-shadow: 0 0 0 3px rgba(0, 130, 186, 0.15);
}

.cfait-input-methods {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
    margin: 24px 0;
}
.cfait-input-method label {
    display: block;
    font-weight: 600;
    color: #0e2238;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.cfait-input-method input[type="file"] {
    display: block;
    padding: 10px 12px;
    border: 1px dashed #cfd8e3;
    border-radius: 8px;
    background: #f6fafd;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}
.cfait-input-method textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    resize: vertical;
    min-height: 200px;
}
.cfait-input-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a9bab;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.cfait-input-divider span {
    padding: 6px 10px;
    background: #ffffff;
    border-radius: 999px;
}
.cfait-hint {
    color: #6b7c90;
    font-size: 0.85rem;
    margin: 6px 0 0;
}
.cfait-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}
.cfait-form-status {
    margin: 0;
    color: #4a5b6f;
    font-size: 0.9rem;
}
.cfait-form-status.is-error {
    color: #b83227;
}

@media (max-width: 720px) {
    .cfait-input-methods {
        grid-template-columns: 1fr;
    }
    .cfait-input-divider {
        padding: 8px 0;
    }
}

/* ---------- History list ---------- */

.cfait-history {
    padding: 20px 0 80px;
}
.cfait-history h2 {
    color: #0e2238;
    font-size: 1.25rem;
    margin: 0 0 16px;
}
.cfait-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #dfe7ef;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}
.cfait-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #eef2f6;
    gap: 12px;
    flex-wrap: wrap;
}
.cfait-history-list li:last-child {
    border-bottom: 0;
}
.cfait-history-title {
    font-weight: 600;
    color: #0082ba;
    text-decoration: none;
}
.cfait-history-title:hover {
    text-decoration: underline;
}
.cfait-history-meta {
    color: #6b7c90;
    font-size: 0.85rem;
}
.cfait-countdown-inline--urgent {
    color: #b83227;
    font-weight: 600;
}

/* ---------- Review view ---------- */

.cfait-review-header {
    background: #f7fbfd;
    padding: 32px 0 20px;
    border-bottom: 1px solid #dfe7ef;
}
.cfait-crumb {
    margin: 0 0 8px;
}
.cfait-crumb a {
    color: #0082ba;
    text-decoration: none;
    font-size: 0.9rem;
}
.cfait-review-header h1 {
    margin: 0 0 8px;
    color: #0e2238;
    font-size: 1.5rem;
}
.cfait-target {
    color: #4a5b6f;
    margin: 0 0 16px;
    font-size: 0.95rem;
}
.cfait-review-meta {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    align-items: center;
    margin-top: 16px;
}
@media (max-width: 900px) {
    .cfait-review-meta {
        grid-template-columns: 1fr;
    }
}

.cfait-progress {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 12px 16px;
}
.cfait-progress-bar {
    background: #eef2f6;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.cfait-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0082ba, #4ab8dc);
    transition: width 0.3s ease;
}
.cfait-progress-label {
    margin: 0;
    color: #4a5b6f;
    font-size: 0.85rem;
}
.cfait-progress-label strong {
    color: #0082ba;
}

.cfait-countdown {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #4a5b6f;
}
.cfait-countdown--urgent {
    background: #fff5f4;
    border-color: #f2c1bc;
    color: #b83227;
    font-weight: 600;
}
.cfait-review-actions {
    display: flex;
    gap: 8px;
}

/* Review body: document on the left, annotations panel on the right */
.cfait-review-body {
    padding: 32px 0 80px;
    background: #ffffff;
}
.cfait-review-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 40px;
    align-items: start;
}
@media (max-width: 1000px) {
    .cfait-review-container {
        grid-template-columns: 1fr;
    }
}

.cfait-cv-document {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 12px;
    padding: 40px 48px;
    color: #0e2238;
    line-height: 1.6;
    font-size: 1rem;
}
.cfait-para {
    margin: 0 0 16px;
}
.cfait-para--heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0e2238;
    margin-top: 24px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cfait-para--list_item {
    margin-left: 20px;
    list-style: disc;
}

/* Highlights */
.cfait-highlight {
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(0, 130, 186, 0.15);
    border-bottom: 2px solid #0082ba;
    color: inherit;
    transition: background 0.15s ease;
}
.cfait-highlight:hover,
.cfait-highlight:focus {
    background: rgba(0, 130, 186, 0.28);
    outline: none;
}
.cfait-highlight--info {
    background: rgba(70, 132, 176, 0.12);
    border-bottom-color: #4684b0;
}
.cfait-highlight--suggestion {
    background: rgba(0, 130, 186, 0.15);
    border-bottom-color: #0082ba;
}
.cfait-highlight--important {
    background: rgba(224, 116, 27, 0.15);
    border-bottom-color: #e0741b;
}
.cfait-highlight--critical {
    background: rgba(184, 50, 39, 0.15);
    border-bottom-color: #b83227;
}
.cfait-highlight--status-done {
    background: rgba(46, 125, 50, 0.10);
    border-bottom-color: #2e7d32;
    opacity: 0.7;
}
.cfait-highlight--status-dismissed {
    background: transparent;
    border-bottom: 1px dashed #b0b8c1;
    opacity: 0.55;
}
.cfait-highlight.is-focused {
    background: rgba(224, 116, 27, 0.35);
}

/* Annotations panel */
.cfait-annotations-panel {
    background: #f7fbfd;
    border: 1px solid #dfe7ef;
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.cfait-annotations-panel h2 {
    margin: 0 0 8px;
    color: #0e2238;
    font-size: 1.1rem;
}
.cfait-panel-hint {
    color: #6b7c90;
    font-size: 0.85rem;
    margin: 0 0 16px;
}
.cfait-annotations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    counter-reset: cfait-annotation;
}
.cfait-annotation {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-left: 4px solid #0082ba;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.9rem;
    counter-increment: cfait-annotation;
    position: relative;
}
.cfait-annotation::before {
    content: counter(cfait-annotation);
    position: absolute;
    top: -8px;
    left: -8px;
    background: #0082ba;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}
.cfait-annotation--info      { border-left-color: #4684b0; }
.cfait-annotation--info::before      { background: #4684b0; }
.cfait-annotation--suggestion { border-left-color: #0082ba; }
.cfait-annotation--important { border-left-color: #e0741b; }
.cfait-annotation--important::before { background: #e0741b; }
.cfait-annotation--critical  { border-left-color: #b83227; }
.cfait-annotation--critical::before  { background: #b83227; }

.cfait-annotation-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cfait-annotation-severity {
    font-weight: 700;
    color: #0e2238;
}
.cfait-annotation-category {
    color: #6b7c90;
}
.cfait-annotation-anchor {
    margin: 0 0 8px;
    padding: 6px 10px;
    background: #f7fbfd;
    border-radius: 6px;
    font-style: italic;
    color: #4a5b6f;
    font-size: 0.85rem;
    border-left: 3px solid #dfe7ef;
}
.cfait-annotation-comment {
    margin: 0 0 6px;
    color: #0e2238;
    line-height: 1.5;
}
.cfait-annotation-suggestion {
    margin: 0 0 8px;
    color: #33475b;
    line-height: 1.5;
    font-size: 0.9rem;
    background: #fff8ee;
    padding: 8px 10px;
    border-radius: 6px;
}

.cfait-annotation-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.cfait-chip {
    background: #ffffff;
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #4a5b6f;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cfait-chip:hover {
    background: #e6f3f8;
    border-color: #0082ba;
    color: #0082ba;
}
.cfait-chip.is-active[data-action-status="done"] {
    background: #e6f4ea;
    border-color: #2e7d32;
    color: #2e7d32;
}
.cfait-chip.is-active[data-action-status="dismissed"] {
    background: #eef0f2;
    border-color: #6b7c90;
    color: #4a5b6f;
}
.cfait-chip--reopen {
    display: none;
}

/* Status modifiers for the whole annotation card */
.cfait-annotation--status-done {
    opacity: 0.6;
}
.cfait-annotation--status-done .cfait-chip[data-action-status="done"] { display: none; }
.cfait-annotation--status-done .cfait-chip[data-action-status="dismissed"] { display: none; }
.cfait-annotation--status-done .cfait-chip--reopen { display: inline-block; }

.cfait-annotation--status-dismissed {
    opacity: 0.5;
}
.cfait-annotation--status-dismissed .cfait-chip[data-action-status="done"] { display: none; }
.cfait-annotation--status-dismissed .cfait-chip[data-action-status="dismissed"] { display: none; }
.cfait-annotation--status-dismissed .cfait-chip--reopen { display: inline-block; }

.cfait-annotation.is-focused {
    box-shadow: 0 0 0 3px rgba(224, 116, 27, 0.35);
}
