/* ========================================
   Escala de Depresión de Zung - Frontend
   ======================================== */

.zds-test-container {
    max-width: 900px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

/* Header */
.zds-header {
    text-align: center;
    margin-bottom: 40px;
}

.zds-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.zds-description {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: left;
    margin-top: 20px;
}

.zds-description p {
    margin-bottom: 15px;
}

.zds-important-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

/* Form */
.zds-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
}

/* Patient Info */
.zds-patient-info {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.zds-patient-info h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 20px;
}

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

.zds-form-row:last-child {
    margin-bottom: 0;
}

.zds-form-group {
    display: flex;
    flex-direction: column;
}

.zds-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #34495e;
    font-size: 14px;
}

.zds-form-group .required {
    color: #e74c3c;
}

.zds-form-group input,
.zds-form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s;
}

.zds-form-group input:focus,
.zds-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Instructions */
.zds-instructions {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.zds-instructions h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.zds-scale-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.legend-item {
    background: rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Questions */
.zds-questions {
    margin-bottom: 30px;
}

.zds-question-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.zds-question-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.zds-question-item.answered {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.question-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.question-number {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 15px;
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.5;
}

.question-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.radio-option {
    cursor: pointer;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
    text-align: center;
    min-height: 80px;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.radio-option:hover .radio-label {
    border-color: var(--primary-color);
    background: rgba(44, 62, 80, 0.05);
}

.radio-option input[type="radio"]:checked + .radio-label:hover {
    background: var(--primary-color);
}

.radio-number {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.radio-text {
    font-size: 12px;
    font-weight: 500;
}

/* Progress Bar */
.zds-progress-bar {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #2ecc71);
    transition: width 0.5s ease;
    opacity: 0.2;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 15px;
}

/* Submit Section */
.zds-submit-section {
    text-align: center;
}

.zds-submit-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.zds-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.zds-submit-btn:active {
    transform: translateY(0);
}

.zds-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results */
.zds-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
    margin-top: 30px;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.results-header h3 {
    color: var(--primary-color);
    font-size: 28px;
    margin: 0;
}

.results-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.score-card {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.score-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.8;
}

.score-value {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 5px;
}

.score-value.level {
    font-size: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    display: inline-block;
}

.score-range {
    font-size: 12px;
    opacity: 0.7;
}

.results-interpretation,
.results-recommendations {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.results-interpretation h4,
.results-recommendations h4 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.results-recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.results-recommendations li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.results-disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 14px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 15px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Error */
.zds-error {
    background: #fee;
    border-left: 4px solid #e74c3c;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.zds-error p {
    margin: 0;
    color: #c0392b;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .zds-test-container {
        margin: 20px;
    }
    
    .zds-form {
        padding: 25px;
    }
    
    .zds-form-row {
        grid-template-columns: 1fr;
    }
    
    .question-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-scores {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .zds-submit-section,
    .results-actions,
    .zds-form {
        display: none !important;
    }
    
    .zds-results {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
