/**
 * PsihoProfile AI Interpreter Frontend Styles - NEW STRUCTURE v8.0
 * CHANGES:
 * - Updated for correct interpretation sections with colored backgrounds
 * - Sections: Interpretare Generală, Stilul de Învățare, Mediul Ideal, Recomandări
 * - Removed "Relația cu colegii" styling
 * - Updated soft skills section for report-specific display
 */

/* --- Base Container Styles --- */
.psihoprofile-ai-summary-container {
    border: 1px solid #e0e0e0;
    padding: 15px 20px;
    margin: 20px 0;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* --- Generate Button --- */
.psihoprofile-ai-generate-button {
    background-color: #2271b1;
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.psihoprofile-ai-generate-button:hover {
    background-color: #1d5f96;
}

.psihoprofile-ai-generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Main Result Container --- */
.psihoprofile-ai-result {
    margin-top: 15px;
    padding: 15px;
    border-top: 1px dashed #ccc;
    background-color: transparent;
    border-radius: 4px;
}

/* --- NEW: Interpretation Sections with Colored Backgrounds --- */
.psihoprofile-ai-section {
    margin-bottom: 15px;
    line-height: 1.7;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.psihoprofile-ai-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.psihoprofile-ai-section p {
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

/* Section-specific background colors (applied inline, but defined here for reference) */
.psihoprofile-ai-section.general {
    background: #e7f3fe;
    border-left: 4px solid #0292B7;
}

.psihoprofile-ai-section.learning {
    background: #f3e8ff;
    border-left: 4px solid #a855f7;
}

.psihoprofile-ai-section.environment {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.psihoprofile-ai-section.recommendations {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

/* --- Report-Specific Soft Skills Section --- */
.psihoprofile-report-soft-skills {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.psihoprofile-report-soft-skills h4 {
    color: #0292B7;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

.psihoprofile-soft-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.psihoprofile-soft-skill-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.psihoprofile-soft-skill-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.psihoprofile-soft-skill-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-size: 14px;
}

.psihoprofile-soft-skill-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psihoprofile-soft-skill-bar-bg {
    flex: 1;
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.psihoprofile-soft-skill-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.psihoprofile-soft-skill-points {
    font-weight: 700;
    min-width: 35px;
    font-size: 14px;
    text-align: right;
}

/* --- Loading States --- */
.psihoprofile-ai-loading,
.psihoprofile-ai-error-msg,
.psihoprofile-ai-error {
    margin-top: 10px;
    padding: 15px;
}

.psihoprofile-ai-error,
.psihoprofile-ai-error-msg {
    color: #dc3232;
    font-weight: bold;
    background: #fff3f3;
    border-left: 4px solid #dc3232;
    border-radius: 4px;
}

.psihoprofile-ai-loading {
    text-align: center;
    padding: 30px 20px;
    background: #e7f3fe;
    border: 2px solid #0292B7;
    border-radius: 8px;
    animation: pulseLoading 2s ease-in-out infinite;
}

.psihoprofile-ai-loading p {
    margin: 10px 0 0 0;
    color: #0c5460;
    font-size: 15px;
    line-height: 1.6;
}

.psihoprofile-ai-loading .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0292B7;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 10px auto;
}

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

@keyframes pulseLoading {
    0%, 100% { 
        border-color: #0292B7; 
        background: #e7f3fe;
    }
    50% { 
        border-color: #05a3d1; 
        background: #d4edfa;
    }
}

/* --- Dashboard Styles (if still needed) --- */
.psihoprofile-career-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.psihoprofile-career-search-input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    flex-grow: 1;
    min-width: 200px;
}

.psihoprofile-career-search-button,
.psihoprofile-clear-search-button {
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.psihoprofile-career-search-button {
    background-color: #2271b1;
    color: white;
    border: 1px solid #2271b1;
}

.psihoprofile-career-search-button:hover {
    background-color: #1d5f96;
}

.psihoprofile-clear-search-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.psihoprofile-clear-search-button:hover {
    background-color: #e0e0e0;
}

.psihoprofile-info-msg {
    background-color: #e7f3fe;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin: 15px 0;
    color: #0c5460;
}

.psihoprofile-results-heading {
    font-size: 1.2em;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.psihoprofile-section-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* --- Tables --- */
.psihoprofile-user-career-match-table,
.psihoprofile-popular-careers-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.psihoprofile-user-career-match-table th,
.psihoprofile-user-career-match-table td,
.psihoprofile-popular-careers-table th,
.psihoprofile-popular-careers-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.psihoprofile-user-career-match-table th,
.psihoprofile-popular-careers-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.psihoprofile-user-career-match-table tbody tr:hover,
.psihoprofile-popular-careers-table tbody tr:hover {
    background-color: #f0f5fa;
}

.psihoprofile-user-avatar {
    border-radius: 50%;
    border: 1px solid #ddd;
    margin-right: 10px;
    vertical-align: middle;
}

.psihoprofile-user-name {
    font-weight: 500;
}

.psihoprofile-percentage-cell {
    text-align: center;
    font-weight: bold;
    color: #007bff;
}

.psihoprofile-count-cell {
    text-align: center;
}

.psihoprofile-popular-career-link {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.psihoprofile-popular-career-link:hover {
    color: #00a0d2;
}

/* --- Dashboard Layout --- */
.psihoprofile-career-dashboard {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 25px 0;
}

.psihoprofile-career-dashboard > h1 {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 1.8em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

.psihoprofile-dashboard-section {
    background-color: #f9fafb;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    border: 1px solid #e9eef2;
}

.psihoprofile-dashboard-section:last-child {
    margin-bottom: 0;
}

#dashboard-charts .psihoprofile-section-title {
    text-align: center;
    border-bottom-width: 1px;
}

.psihoprofile-charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
    margin-top: 20px;
}

.psihoprofile-chart-wrapper {
    flex: 1 1 400px;
    min-width: 300px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    height: 350px;
}

.psihoprofile-chart-wrapper h3 {
    text-align: center;
    font-size: 1.1em;
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
}

#psihoprofileCareerPieChart,
#psihoprofileCareerBarChart {
    max-width: 100%;
    max-height: 100%;
}

/* --- Modal Styles --- */
.psihoprofile-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.psihoprofile-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #b8b8b8;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation-name: psmodalopen;
    animation-duration: 0.4s;
}

@keyframes psmodalopen {
    from {
        top: -200px;
        opacity: 0;
    }
    to {
        top: 0;
        opacity: 1;
    }
}

.psihoprofile-modal-close {
    color: #777;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.psihoprofile-modal-close:hover,
.psihoprofile-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.psihoprofile-modal-content h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.3em;
}

.psihoprofile-modal-user-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
}

.psihoprofile-modal-user-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.psihoprofile-modal-user-item:last-child {
    border-bottom: none;
}

.psihoprofile-modal-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.psihoprofile-modal-user-name {
    flex-grow: 1;
    font-size: 1em;
    color: #444;
}

.psihoprofile-modal-user-percentage {
    font-weight: bold;
    font-size: 1em;
    color: #007bff;
    min-width: 50px;
    text-align: right;
}

/* --- Responsive Design --- */
@media (max-width: 767px) {
    .psihoprofile-soft-skills-grid {
        grid-template-columns: 1fr;
    }
    
    .psihoprofile-charts-container {
        flex-direction: column;
        align-items: center;
    }
    
    .psihoprofile-chart-wrapper {
        width: 95%;
        max-width: 450px;
        flex-basis: auto;
        height: 300px;
    }
    
    .psihoprofile-career-dashboard > h1 {
        font-size: 1.5em;
    }
    
    .psihoprofile-section-title {
        font-size: 1.2em;
    }
    
    .psihoprofile-modal-content {
        width: 90%;
        margin: 15% auto;
    }
    
    .psihoprofile-career-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .psihoprofile-career-search-input {
        width: 100%;
    }
    
    .psihoprofile-ai-section h4 {
        font-size: 14px;
    }
    
    .psihoprofile-ai-section p {
        font-size: 13px;
    }
}