/**
 * Ultimate CV Tailoring Styles
 * Using brand colors: Cream, Navy Blue, Dark Forest Green, Gold Gradient
 * 
 * @version 4.0.0
 */

:root {
    --cream: #FFF8F3;
    --cream-light: #FFFEF9;
    --navy: #132D51;
    --navy-light: #1E4670;
    --forest-green: #2D6A4F;
    --forest-green-light: #3D8B68;
    --gold-gradient: linear-gradient(135deg, #B08D57 0%, #CB997E 100%);
    --gold-primary: #B08D57;
    --gold-secondary: #CB997E;
    --error: #D32F2F;
    --success: #2D6A4F;
    --text-dark: #132D51;
    --text-light: #6B7280;
    --border-light: #E5E7EB;
}

/* Modal Overlay */
.sffc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(19, 45, 81, 0.7); /* Navy blue overlay */
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

/* Modal Content */
.sffc-modal-content {
    background: var(--cream-light);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(19, 45, 81, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp 0.3s ease;
}

.sffc-modal-content.sffc-modal-large {
    max-width: 800px;
}

.sffc-modal-content.sffc-modal-small {
    max-width: 400px;
    text-align: center;
    padding: 2rem;
}

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

/* Modal Header */
.sffc-modal-header {
    background: var(--gold-gradient);
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sffc-modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.ultimate-cv-modal-close {
    color: white;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.ultimate-cv-modal-close:hover {
    opacity: 0.7;
}

/* Modal Body */
.sffc-modal-body {
    padding: 2rem;
}

.sffc-modal-body p {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* CV Upload Area */
.cv-upload-area {
    border: 2px dashed var(--forest-green);
    border-radius: 8px;
    padding: 2rem;
    background: white;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.cv-upload-area.drag-over {
    background: var(--cream);
    border-color: var(--gold-primary);
    transform: scale(1.02);
}

.cv-upload-area input[type="file"] {
    display: none;
}

.cv-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--forest-green);
    transition: all 0.3s ease;
}

.cv-upload-label:hover {
    color: var(--forest-green-light);
}

.cv-upload-label svg {
    margin-bottom: 1rem;
    stroke: currentColor;
}

.cv-upload-label span {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--navy);
}

.cv-upload-label small {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* File Info */
#cv-file-info {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

#cv-file-info p {
    margin: 0.25rem 0;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Status Messages */
#cv-upload-status {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
}

#cv-upload-status.error {
    background: #FFEBEE;
    color: var(--error);
    border: 1px solid #FFCDD2;
    display: block;
}

#cv-upload-status.success {
    background: #E8F5E9;
    color: var(--success);
    border: 1px solid #C8E6C9;
    display: block;
}

#cv-upload-status.processing {
    background: var(--cream);
    color: var(--gold-primary);
    border: 1px solid var(--gold-secondary);
    display: block;
}

/* Buttons */
.sffc-btn-primary {
    background: var(--gold-gradient);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(176, 141, 87, 0.2);
}

.sffc-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 141, 87, 0.3);
}

.sffc-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sffc-btn-secondary {
    background: var(--forest-green);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sffc-btn-secondary:hover {
    background: var(--forest-green-light);
    transform: translateY(-2px);
}

.sffc-btn-outline {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sffc-btn-outline:hover {
    background: var(--navy);
    color: white;
}

/* Tailor Button on Job Cards */
/* Note: sffc-btn-tailor styles are now in senna-vogue.css for consistency */
.tailor-cv-btn,
.cv-tailor-button {
    background: var(--gold-gradient) !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1rem !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(176, 141, 87, 0.2) !important;
    min-height: 42px !important;
}

.tailor-cv-btn:hover,
.cv-tailor-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(176, 141, 87, 0.3) !important;
}

/* Results Summary */
.results-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.match-score {
    flex-shrink: 0;
}

.score-circle {
    width: 100px;
    height: 100px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(176, 141, 87, 0.3);
}

.score-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: white;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.job-details h3 {
    color: var(--navy);
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.job-details p {
    color: var(--text-light);
    margin: 0;
    font-size: 1rem;
}

/* Recommendations Section */
.recommendations-section,
.improvements-section {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.recommendations-section h3,
.improvements-section h3,
.keywords-section h3 {
    color: var(--navy);
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.recommendations-section ul,
.improvements-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recommendations-section li,
.improvements-section li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.recommendations-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--forest-green);
    font-weight: bold;
    font-size: 1.125rem;
}

.improvements-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--gold-primary);
    font-weight: bold;
}

/* Keywords Section */
.keywords-section {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--cream);
    color: var(--forest-green);
    border: 1px solid var(--forest-green);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Processing Modal */
.processing-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--cream);
    border-top: 4px solid var(--gold-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.sffc-modal-small p {
    color: var(--navy);
    font-size: 1.125rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sffc-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .results-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
}

/* Override any existing non-brand colors */
.sffc-modal-overlay *,
.sffc-modal-content *,
#ultimate-cv-modal *,
#ultimate-results-modal *,
#processing-modal * {
    /* Ensure only brand colors are used */
    --primary-color: var(--gold-primary) !important;
    --secondary-color: var(--forest-green) !important;
    --accent-color: var(--navy) !important;
}