/**
 * Resume Review Feature Styles
 * Secure and accessible UI components
 */

/* Privacy Consent Dialog */
.consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.consent-dialog {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.consent-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid #e0e0e0;
}

.consent-header h3 {
    margin: 0 0 16px;
    font-size: 1.25rem;
    color: #333;
}

.consent-content {
    padding: 24px;
    line-height: 1.6;
}

.consent-content h4 {
    color: #333;
    margin: 20px 0 10px;
    font-size: 1.1rem;
}

.consent-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.consent-content li {
    margin: 8px 0;
}

.consent-content p {
    margin: 12px 0;
}

.consent-content small {
    color: #666;
    font-size: 0.9rem;
}

.consent-buttons {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.consent-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.consent-buttons .btn-primary {
    background: #10182f;
    color: white;
}

.consent-buttons .btn-primary:hover {
    background: #0052A3;
}

.consent-buttons .btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.consent-buttons .btn-secondary:hover {
    background: #e9ecef;
}

/* Progress State */
.resume-progress-section {
    text-align: center;
    padding: 40px 20px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.progress-ring {
    position: relative;
    display: inline-block;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-circle {
    transition: stroke-dashoffset 0.3s ease;
}

/* Indeterminate state for server-side processing */
.progress-ring.indeterminate svg {
    animation: rotateRing 1.2s linear infinite;
}
.progress-ring.indeterminate .progress-text {
    opacity: 0.5;
}

@keyframes rotateRing {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #10182f;
}

.progress-percentage {
    font-size: 1.2rem;
}

.progress-message {
    max-width: 300px;
}

.progress-status {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin: 0 0 8px;
}

.progress-details {
    color: #666;
    font-size: 0.9rem;
}

/* Stepper under progress ring */
.progress-steps {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.progress-steps .step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9aa0a6;
    font-size: 0.9rem;
}

.progress-steps .step .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d6d9dd;
}

.progress-steps .step.active {
    color: #333;
}

.progress-steps .step.active .dot {
    background: #0066CC;
}

.progress-steps .step.completed {
    color: #2e7d32;
}

.progress-steps .step.completed .dot {
    background: #27AE60;
}

/* Upload Area Enhancements */
.resume-upload-area {
    position: relative;
    transition: all 0.2s ease;
}

.resume-upload-area.drag-over {
    border-color: #10182f;
    background-color: #f0f8ff;
    transform: scale(1.02);
}

.resume-upload-area:hover {
    border-color:#10182f;
    background-color: #f8f9fa;
}

/* Error Display */
.resume-error {
    animation: slideDown 0.3s ease;
}

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

/* Analysis Results Enhancements */
.analysis-header {
    margin-bottom: 32px;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.score-circle svg {
    transition: all 0.5s ease;
}

.analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.analysis-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.analysis-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.analysis-item.strength {
    border-left: 4px solid #27AE60;
}

.analysis-item.improvement {
    border-left: 4px solid #F39C12;
}

.analysis-item.missing {
    border-left: 4px solid #E74C3C;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.item-header strong {
    font-size: 1.1rem;
    color: #333;
}

.analysis-item ul {
    margin: 0;
    padding-left: 20px;
}

.analysis-item li {
    margin: 8px 0;
    line-height: 1.5;
}

/* Resume Modal Base Styles */
.resume-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resume-modal.show {
    opacity: 1;
}

/* Accessibility Improvements */
.resume-modal[role="dialog"] {
    outline: none;
}

.resume-modal-backdrop {
    cursor: pointer;
}

.resume-modal-content {
    outline: none;
}

/* Focus states */
.resume-upload-area:focus-within {
    outline: 2px solid #10182f;
    outline-offset: 2px;
}

.consent-buttons button:focus {
    outline: 2px solid #10182f;
    outline-offset: 2px;
}

/* Loading states */
.analysis-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.analysis-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #10182f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .consent-dialog {
        margin: 10px;
        max-height: 95vh;
    }
    
    .consent-content {
        padding: 16px;
    }
    
    .consent-buttons {
        flex-direction: column;
        padding: 0 16px 16px;
    }
    
    .consent-buttons button {
        width: 100%;
    }
    
    .match-score {
        flex-direction: column;
        gap: 12px;
    }
    
    .progress-container {
        gap: 16px;
    }
    
    .resume-upload-area.drag-over {
        transform: none; /* Reduce transform on mobile */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .consent-dialog {
        border: 2px solid #000;
    }
    
    .analysis-item {
        border-width: 2px;
    }
    
    .consent-buttons .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .consent-buttons .btn-secondary {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .resume-upload-area,
    .progress-circle,
    .score-circle svg,
    .analysis-item {
        transition: none;
    }
    
    .resume-upload-area.drag-over {
        transform: none;
    }
    
    @keyframes spin {
        to { transform: none; }
    }

    .progress-ring.indeterminate svg {
        animation: none;
    }
}

/* Print styles */
@media print {
    .consent-overlay,
    .progress-section {
        display: none;
    }
    
    .analysis-sections {
        break-inside: avoid;
    }
    
    .analysis-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Tabs for Resume Review Modal */
.resume-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
    color: #666;
    position: relative;
    transition: color 0.2s ease;
}

.tab-link.active {
    color: #10182f;
    font-weight: 600;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #10182f;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Recent Reviews List */
.recent-reviews-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.recent-reviews-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.recent-reviews-list li:last-child {
    border-bottom: none;
}

.review-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-item-info span:first-child {
    font-weight: 600;
    color: #333;
}

.review-item-info span:last-child {
    font-size: 0.9rem;
    color: #666;
}

.view-details-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.view-details-btn:hover {
    background-color: #e0e0e0;
}

.no-reviews-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.loading-spinner::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #10182f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
