/* ===== ATS ANALYZER STYLES ===== */

:root {
    --ats-card-bg: #fafafa;
    --ats-input-bg: #fafafa;
    --ats-input-focus-bg: #ffffff;
    --ats-border: #e0e0e0;
    --ats-text-primary: #333333;
    --ats-text-secondary: #666666;
    --ats-text-muted: #999999;
    --ats-item-bg: #ffffff;
    --ats-btn-sec-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ats-card-bg: rgba(255, 255, 255, 0.05);
        --ats-input-bg: rgba(255, 255, 255, 0.05);
        --ats-input-focus-bg: rgba(255, 255, 255, 0.1);
        --ats-border: rgba(255, 255, 255, 0.1);
        --ats-text-primary: #ffffff;
        --ats-text-secondary: #dddddd;
        --ats-text-muted: #aaaaaa;
        --ats-item-bg: rgba(255, 255, 255, 0.08);
        --ats-btn-sec-bg: transparent;
    }
}

.ats-container {
    max-width: 800px; /* Centered narrow container */
    margin: 0 auto;
    padding: 40px 20px;
    color: var(--ats-text-primary);
}

.ats-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease;
}

.ats-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #717274, #2657cb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ats-subtitle {
    font-size: 1.1rem;
    color: var(--ats-text-secondary);
    max-width: 600px;
    margin: 0 auto !important;
}

.ats-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 40px;
    margin-bottom: 40px;
}

/* ===== LEFT COLUMN - INPUTS ===== */
.ats-inputs, .ats-results {
    width: 100%;
    animation: fadeIn 0.6s ease;
}

.ats-input-group {
    margin-bottom: 30px;
    width: 100%;
}

.ats-input-group label {
    display: block;
    font-weight: 600;
    color: var(--ats-text-primary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.ats-textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 2px solid var(--ats-border);
    border-radius: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--ats-input-bg);
    color: var(--ats-text-primary);
}

.ats-textarea:focus {
    outline: none;
    border-color: #2657cb;
    background: var(--ats-input-focus-bg);
    box-shadow: 0 0 0 3px rgba(38, 87, 203, 0.1);
}

.ats-textarea::placeholder {
    color: var(--ats-text-muted);
}

/* ===== FILE UPLOAD ===== */
.ats-upload-group {
    margin-bottom: 30px;
    width: 100%;
}

.ats-upload-group label {
    display: block;
    font-weight: 600;
    color: var(--ats-text-primary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.ats-upload-area {
    border: 2px dashed #2657cb;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    background: linear-gradient(135deg, rgba(38, 87, 203, 0.05), rgba(181, 184, 188, 0.05));
    cursor: pointer;
    transition: all 0.3s ease;
}

.ats-upload-area:hover {
    border-color: #1a3f99;
    background: linear-gradient(135deg, rgba(38, 87, 203, 0.1), rgba(181, 184, 188, 0.1));
}

.ats-upload-area.dragover {
    border-color: #1a3f99;
    background: linear-gradient(135deg, rgba(38, 87, 203, 0.15), rgba(181, 184, 188, 0.15));
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: #2657cb;
    margin-bottom: 12px;
    stroke-width: 2;
}

.ats-upload-area p {
    margin: 8px 0;
    color: var(--ats-text-secondary);
    font-size: 0.95rem;
}

.upload-button {
    margin-top: 16px;
    padding: 10px 24px;
    background: #2657cb;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-button:hover {
    background: #1a3f99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 87, 203, 0.3);
}

#fileStatus {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--ats-text-secondary);
}

#fileStatus.success {
    color: #27ae60;
}

#fileStatus.error {
    color: #e74c3c;
}

/* ===== ANALYZE BUTTON ===== */
.ats-btn-analyze {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2657cb, #1a3f99);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(38, 87, 203, 0.3);
}

.ats-btn-analyze:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(38, 87, 203, 0.4);
}

.ats-btn-analyze:active:not(:disabled) {
    transform: translateY(-1px);
}

.ats-btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== RIGHT COLUMN - RESULTS ===== */
.ats-score-section {
    text-align: center;
    margin-bottom: 40px;
}

.ats-score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    position: relative;
}

.ats-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle-bg {
    fill: none;
    stroke: var(--ats-border);
    stroke-width: 8;
}

.score-circle-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease, stroke 0.3s ease;
}

/* Score color based on value */
.score-circle-fill.score-red {
    stroke: #e74c3c;
}

.score-circle-fill.score-yellow {
    stroke: #f39c12;
}

.score-circle-fill.score-light-green {
    stroke: #27ae60;
}

.score-circle-fill.score-green {
    stroke: #229954;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: #2657cb;
}

.score-label {
    font-size: 1rem;
    color: var(--ats-text-muted);
}

.score-feedback {
    font-size: 1rem;
    color: var(--ats-text-secondary);
    max-width: 100%;
    margin: 0 !important;
    font-style: italic;
}

/* ===== METRICS ===== */
.ats-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--ats-card-bg);
    border: 1px solid var(--ats-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: #2657cb;
    box-shadow: 0 4px 12px rgba(38, 87, 203, 0.1);
}

.metric-header {
    font-weight: 600;
    color: var(--ats-text-primary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2657cb;
    margin-bottom: 8px;
}

.metric-bar {
    width: 100%;
    height: 8px;
    background: var(--ats-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.metric-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2657cb, #764ba2);
    border-radius: 4px;
    transition: width 1s ease;
    width: 0%;
}

.metric-content small {
    font-size: 0.85rem;
    color: var(--ats-text-muted);
}

/* Skill Tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ats-item-bg);
    border: 1px solid var(--ats-border);
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--ats-text-primary);
}

.skill-tag.found {
    background: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
    color: #27ae60;
}

.skill-tag.missing {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
}

.skill-icon {
    width: 14px;
    height: 14px;
}

/* Structure Items */
.structure-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.structure-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--ats-text-secondary);
    padding: 8px;
    background: var(--ats-item-bg);
    border: 1px solid var(--ats-border);
    border-radius: 6px;
}

.structure-item.present {
    color: #27ae60;
}

.structure-item.missing {
    color: #e74c3c;
}

.status-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkmark {
    color: #27ae60;
    font-weight: bold;
}

.xmark {
    color: #e74c3c;
    font-weight: bold;
}

/* Seniority Badge */
.seniority-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2657cb, #764ba2);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== SUGGESTIONS ===== */
.ats-suggestions {
    background: var(--ats-card-bg);
    border: 1px solid var(--ats-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.ats-suggestions h3 {
    font-size: 1.1rem;
    color: var(--ats-text-primary);
    margin: 0 0 20px 0;
    font-weight: 600;
}

#suggestionsContent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--ats-item-bg);
    border-left: 3px solid #2657cb;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ats-text-primary);
    border-top: 1px solid var(--ats-border);
    border-right: 1px solid var(--ats-border);
    border-bottom: 1px solid var(--ats-border);
}

.suggestion-item.positive {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
}

.suggestion-item.warning {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.05);
}

.suggestion-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ===== ACTION BUTTONS ===== */
.ats-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.ats-btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--ats-btn-sec-bg);
    border: 2px solid #2657cb;
    color: #2657cb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ats-btn-secondary:hover {
    background: #2657cb;
    color: white;
    box-shadow: 0 4px 12px rgba(38, 87, 203, 0.3);
}

.ats-btn-secondary svg {
    stroke-width: 2;
}

/* ===== LOADING STATE ===== */
.ats-loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.ats-loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
    max-width: 100% !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .ats-container {
        padding: 24px 16px;
    }

    .ats-header {
        margin-bottom: 30px;
    }

    .ats-header h1 {
        font-size: 2rem;
    }

    .ats-subtitle {
        font-size: 1rem;
    }

    .ats-content {
        gap: 20px;
    }

    .ats-textarea {
        min-height: 150px;
    }

    .ats-score-circle {
        width: 160px;
        height: 160px;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .ats-actions {
        flex-direction: column;
    }

    .ats-btn-secondary {
        width: 100%;
    }

    .metric-card {
        padding: 16px;
    }

    .ats-suggestions {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .ats-container {
        padding: 16px;
    }

    .ats-header h1 {
        font-size: 1.5rem;
    }

    .ats-header {
        margin-bottom: 20px;
    }

    .ats-input-group,
    .ats-upload-group {
        margin-bottom: 20px;
    }

    .ats-textarea {
        min-height: 120px;
        font-size: 0.9rem;
    }

    .ats-upload-area {
        padding: 20px;
    }

    .upload-icon {
        width: 32px;
        height: 32px;
    }

    .ats-score-circle {
        width: 140px;
        height: 140px;
        margin: 0 auto 16px;
    }

    .score-number {
        font-size: 2rem;
    }

    .score-label {
        font-size: 0.9rem;
    }

    .metric-card {
        padding: 12px;
    }

    .skill-tags {
        gap: 6px;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .suggestion-item {
        font-size: 0.9rem;
        padding: 10px;
    }

    .ats-btn-secondary {
        font-size: 0.9rem;
        padding: 10px 12px;
        gap: 6px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .ats-inputs,
    .ats-actions,
    .upload-button {
        display: none;
    }

    .ats-results {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .metric-card {
        page-break-inside: avoid;
    }

    .ats-suggestions {
        page-break-inside: avoid;
    }
}
