/* Symptoms DB Application Styles */

.symptoms-db-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.symptoms-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.symptoms-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Form Container */
.symptoms-form-container {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.symptoms-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.symptoms-form-title {
    color: #007cba;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.symptoms-form-description {
    color: #6c757d;
    font-size: 1.1em;
    line-height: 1.5;
    margin: 0;
}

/* Symptom Groups */
.symptom-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.symptom-group-title {
    color: #495057;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.symptom-group-title::before {
    content: "📋";
    margin-right: 8px;
    font-size: 1.1em;
}

.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.symptom-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.symptom-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

.symptom-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.symptom-item label {
    flex: 1;
    color: #495057;
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}

.symptom-item.symptom-selected {
    background: #e7f3ff;
    border-color: #007cba;
}

/* Assessment Button */
.assessment-section {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.assess-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.assess-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.assess-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Display */
.assessment-results {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin-top: 20px;
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0);
    animation: fadeInUp 0.5s ease-out;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-title {
    color: #007cba;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.results-score {
    font-size: 3em;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

.score-label {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* Comparison Section */
.comparison-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.comparison-title {
    color: #495057;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-item {
    text-align: center;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.comparison-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.comparison-label {
    color: #6c757d;
    font-size: 0.9em;
}

.user-score {
    color: #007cba;
}

.average-score {
    color: #6c757d;
}

/* Interpretation */
.interpretation-section {
    background: #e8f4fd;
    border-left: 4px solid #17a2b8;
    padding: 20px;
    border-radius: 0 6px 6px 0;
    margin-top: 20px;
}

.interpretation-title {
    color: #0c5460;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
}

.interpretation-text {
    color: #0c5460;
    line-height: 1.6;
    margin: 0;
}

/* Action Buttons */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.save-button {
    background: #28a745;
    color: white;
}

.save-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.retake-button {
    background: #6c757d;
    color: white;
}

.retake-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Progress Bar */
.symptom-progress {
    background: #e9ecef;
    border-radius: 20px;
    height: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.symptom-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #28a745);
    border-radius: 20px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .symptoms-db-form {
        padding: 10px;
    }

    .symptoms-form-container {
        padding: 20px;
    }

    .symptoms-form-title {
        font-size: 1.6em;
    }

    .symptoms-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .symptom-item {
        padding: 10px 12px;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .results-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-button {
        width: 100%;
        max-width: 250px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .symptoms-db-form {
        background: #1e1e1e;
        color: #e1e1e1;
    }

    .symptoms-form-container,
    .assessment-results {
        background: #2d2d2d;
        border-color: #404040;
    }

    .symptom-group {
        background: #2d2d2d;
        border-color: #404040;
    }

    .symptom-item {
        background: #2d2d2d;
        border-color: #404040;
        color: #e1e1e1;
    }

    .symptom-item.symptom-selected {
        background: #1e3a5f;
        border-color: #007cba;
    }

    .symptom-item label {
        color: #e1e1e1;
    }

    .comparison-section {
        background: #2d2d2d;
    }

    .comparison-item {
        background: #1e1e1e;
        border-color: #404040;
    }

    .comparison-label {
        color: #a0a0a0;
    }
}

/* Accessibility */
.symptom-item:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.assess-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.action-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation for step transitions */
.cbt-step {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for buttons */
.assess-button.loading {
    position: relative;
    color: transparent;
}

.assess-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error states */
.symptoms-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

/* Success states */
.symptoms-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

/* Statistics display in admin */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recent assessments table */
.recent-assessments {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.recent-assessments table {
    width: 100%;
    border-collapse: collapse;
}

.recent-assessments th,
.recent-assessments td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.recent-assessments th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.recent-assessments tbody tr:hover {
    background: #f8f9fa;
}
