/**
 * Стили для модального окна AI-анализа совпадения вакансии с резюме
 */

/* Модальное окно */
#aiMatchAnalysisModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-ai-match {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-ai-match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e8e8e8;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.modal-ai-match-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-ai-match-header h3 i {
    font-size: 22px;
}

.modal-ai-match-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-ai-match-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-ai-match-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 140px);
}

.modal-ai-match-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    border-top: 1px solid #e8e8e8;
    background-color: #f9f9f9;
}

.footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Match Score Display */
.ai-match-score-display {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.ai-match-score-display.ai-match-score-excellent {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.ai-match-score-display.ai-match-score-good {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

.ai-match-score-display.ai-match-score-average {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.ai-match-score-display.ai-match-score-poor {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.ai-match-score-display.ai-match-score-very-poor {
    background: linear-gradient(135deg, #721c24 0%, #f5c6cb 100%);
    color: white;
}

.ai-match-score-value {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.ai-match-score-excellent .ai-match-score-value,
.ai-match-score-good .ai-match-score-value {
    color: #28a745;
}

.ai-match-score-average .ai-match-score-value {
    color: #ffc107;
}

.ai-match-score-poor .ai-match-score-value,
.ai-match-score-very-poor .ai-match-score-value {
    color: #dc3545;
}

.ai-match-score-label {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}

.ai-match-score-excellent .ai-match-score-label,
.ai-match-score-good .ai-match-score-label {
    color: #28a745;
}

.ai-match-score-average .ai-match-score-label {
    color: #856404;
}

.ai-match-score-poor .ai-match-score-label,
.ai-match-score-very-poor .ai-match-score-label {
    color: #721c24;
}

/* Recommendation Badge */
.ai-match-recommendation {
    text-align: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 25px;
    background: #f8f9fa;
}

.ai-match-recommendation.strong-match {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ai-match-recommendation.good-match {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.ai-match-recommendation.partial-match {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ai-match-recommendation.weak-match,
.ai-match-recommendation.poor-match {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Summary Box */
.ai-match-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.ai-match-summary h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-match-summary-text {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.95;
}

/* Sections */
.ai-match-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.ai-match-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-match-section-title i {
    color: #2ecc71;
}

/* Requirements */
.ai-match-requirements-group {
    margin-bottom: 15px;
}

.ai-match-requirements-group:last-child {
    margin-bottom: 0;
}

.ai-match-req-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-match-req-title.met {
    color: #28a745;
}

.ai-match-req-title.partial {
    color: #ffc107;
}

.ai-match-req-title.missing {
    color: #dc3545;
}

.ai-match-req-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-match-req-list li {
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    border-left: 4px solid #dee2e6;
}

.ai-match-req-list li.met {
    border-left-color: #28a745;
    background: #e8f5e9;
}

.ai-match-req-list li.partial {
    border-left-color: #ffc107;
    background: #fff3e0;
}

.ai-match-req-list li.missing {
    border-left-color: #dc3545;
    background: #ffebee;
}

/* Skills */
.ai-match-skills-group {
    margin-bottom: 15px;
}

.ai-match-skills-group:last-child {
    margin-bottom: 0;
}

.ai-match-skills-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.ai-match-skills-title.matched {
    color: #28a745;
}

.ai-match-skills-title.transferable {
    color: #17a2b8;
}

.ai-match-skills-title.missing {
    color: #dc3545;
}

.ai-match-skills-title.bonus {
    color: #6f42c1;
}

.ai-match-skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-match-skill-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.ai-match-skill-tag.matched {
    background: #d4edda;
    color: #155724;
}

.ai-match-skill-tag.transferable {
    background: #d1ecf1;
    color: #0c5460;
}

.ai-match-skill-tag.missing {
    background: #f8d7da;
    color: #721c24;
}

.ai-match-skill-tag.bonus {
    background: #e2d5f1;
    color: #4a2c7a;
}

/* Experience Grid */
.ai-match-experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.ai-match-exp-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.ai-match-exp-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ai-match-exp-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Deal Breakers */
.ai-match-deal-breakers {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-match-deal-breaker {
    padding: 12px 15px;
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #721c24;
}

/* Tailoring Tips */
.ai-match-tailoring-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-match-tip {
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #e9ecef;
}

.tip-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Keywords */
.ai-match-keywords-group {
    margin-bottom: 15px;
}

.ai-match-keywords-group:last-child {
    margin-bottom: 0;
}

.ai-match-kw-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.ai-match-kw-title.matched {
    color: #28a745;
}

.ai-match-kw-title.missing {
    color: #dc3545;
}

.ai-match-kw-title.phrases {
    color: #6f42c1;
}

.ai-match-keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-match-keyword-tag {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.ai-match-keyword-tag.matched {
    background: #d4edda;
    color: #155724;
}

.ai-match-keyword-tag.missing {
    background: #f8d7da;
    color: #721c24;
}

.ai-match-keyword-tag.phrase {
    background: #e2d5f1;
    color: #4a2c7a;
    font-style: italic;
}

/* Buttons */
.ai-match-copy-btn,
.ai-match-close-btn,
.ai-restart-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-match-copy-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.ai-match-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.ai-match-close-btn {
    background: #f5f5f5;
    color: #333;
}

.ai-match-close-btn:hover {
    background: #e0e0e0;
}

.ai-restart-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.ai-restart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

/* Redirect Button */
.ai-redirect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 15px;
    transition: transform 0.2s;
}

.ai-redirect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Notification */
.ai-match-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-match-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-match-notification .notification-content i {
    font-size: 20px;
}

.ai-match-notification .notification-content span {
    font-size: 14px;
    font-weight: 500;
}

.ai-match-notification .notification-content button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-match-notification .notification-content button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-ai-match {
        width: 95%;
        max-height: 90vh;
    }

    .modal-ai-match-header {
        padding: 15px 20px;
    }

    .modal-ai-match-body {
        padding: 20px;
    }

    .modal-ai-match-footer {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .ai-match-score-value {
        font-size: 48px;
    }

    .ai-match-experience-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .modal-ai-match-header h3 {
        font-size: 16px;
    }

    .ai-match-score-value {
        font-size: 36px;
    }
}

/* Скроллбар */
.modal-ai-match-body::-webkit-scrollbar {
    width: 8px;
}

.modal-ai-match-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-ai-match-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-ai-match-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Блок оценки качества анализа */
.rating-block {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    padding: 0;
}

.rating-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.thumb-btn {
    padding: 6px 14px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.thumb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.thumb-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.thumb-up:hover {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

.thumb-down:hover {
    border-color: #f44336;
    background: #ffebee;
    color: #c62828;
}

.rating-thanks {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    padding: 0;
    font-size: 15px;
    color: #4caf50;
    font-weight: 600;
}

.rating-thanks i {
    font-size: 20px;
}
