/* ATS Optimizer Modal Styles */

.ats-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ats-modal-overlay.active {
    display: flex;
}

.ats-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.ats-modal-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ats-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.ats-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.ats-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.ats-step {
    display: none;
}

.ats-step.active {
    display: block;
}

/* Upload Step */
.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.section-label i {
    color: var(--primary-color);
}

.file-drop {
    border: 2px dashed var(--border-medium);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
    margin-bottom: 1.5rem;
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--primary-color);
    background: rgba(245, 57, 57, 0.03);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.drop-content i {
    font-size: 2rem;
    color: var(--primary-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.file-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.file-info span {
    flex: 1;
    font-weight: 500;
}

.remove-file {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.jd-section {
    margin-bottom: 1.5rem;
}

.jd-section textarea {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.jd-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.char-info {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.options-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option {
    flex: 1;
}

.option label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.option select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
}

/* Score Row */
.score-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.score-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-light);
}

.score-box.main {
    background: var(--primary-color);
    border: none;
}

.score-box.main .score-num,
.score-box.main .score-text {
    color: white;
}

.score-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-num.danger { color: #ef4444; }
.score-num.warning { color: #f59e0b; }
.score-num.success { color: #10b981; }

.score-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Tabs */
.tabs-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}

.tabs-header .tab {
    flex: 1;
    padding: 0.875rem;
    background: none;
    border: none;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tabs-header .tab:hover {
    background: var(--bg-primary);
}

.tabs-header .tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tabs-body {
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Keyword Items */
.kw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-light);
}

.kw-item:last-child {
    margin-bottom: 0;
}

.kw-name {
    font-weight: 500;
    color: var(--text-primary);
}

.kw-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
}

.kw-status.missing {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kw-status.weak {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.kw-status.strong {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Issue Items */
.issue-item {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--border-medium);
}

.issue-item:last-child {
    margin-bottom: 0;
}

.issue-item.high { border-left-color: #ef4444; }
.issue-item.medium { border-left-color: #f59e0b; }
.issue-item.low { border-left-color: #3b82f6; }

.issue-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.issue-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Suggestions */
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stats-info {
    display: flex;
    gap: 1rem;
}

.stats-info .stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.stats-info .stat.success { color: #10b981; }
.stats-info .stat.danger { color: #ef4444; }
.stats-info .stat.warning { color: #f59e0b; }

.suggestions-body {
    max-height: 300px;
    overflow-y: auto;
}

.sug-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.sug-card:last-child {
    margin-bottom: 0;
}

.sug-card.accepted {
    border-color: #10b981;
}

.sug-card.rejected {
    border-color: #ef4444;
    opacity: 0.6;
}

.sug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.sug-section {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.sug-conf {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.sug-conf.high { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.sug-conf.medium { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.sug-conf.low { background: rgba(107, 114, 128, 0.1); color: #6b7280; }

.sug-body {
    padding: 1rem;
}

.sug-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sug-col {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.sug-col.original {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--border-medium);
}

.sug-col.suggested {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid #10b981;
}

.sug-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.sug-keywords {
    margin-top: 0.5rem;
}

.sug-kw {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 4px;
    margin-right: 0.25rem;
}

.sug-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-light);
}

.sug-actions .btn {
    flex: 1;
}

/* Preview */
.preview-toggle {
    display: inline-flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.preview-toggle .toggle {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    border-radius: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.preview-toggle .toggle.active {
    background: var(--primary-color);
    color: white;
}

.preview-box {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    min-height: 300px;
    overflow: hidden;
}

.preview-content {
    padding: 1.5rem;
}

#textPreview {
    margin: 0;
    font-family: monospace;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    color: #333;
}

/* Loading */
.loading-content {
    text-align: center;
    padding: 3rem;
}

.loading-content .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .ats-modal {
        max-height: 95vh;
    }
    
    .ats-modal-body {
        max-height: calc(95vh - 70px);
    }
    
    .score-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .options-section {
        flex-direction: column;
    }
    
    .sug-row {
        grid-template-columns: 1fr;
    }
    
    .suggestions-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-info {
        justify-content: center;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Score Level Badge */
.score-level {
    text-align: center;
    margin-bottom: 1rem;
}

.level-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-badge.poor {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.level-badge.fair {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.level-badge.good {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.level-badge.excellent {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Top Problems Section */
.top-problems-section {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.top-problems-section h5 {
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.top-problems-list {
    margin: 0;
    padding-left: 1.25rem;
}

.top-problems-list li {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.top-problems-list li:last-child {
    margin-bottom: 0;
}

/* Issue Hint */
.issue-hint {
    font-size: 0.75rem;
    color: #f59e0b;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-light);
}

.issue-hint i {
    margin-right: 0.25rem;
}
