/**
 * PANSS Demo - Positive and Negative Syndrome Scale
 * Psychiatric Assessment Tool with Modern Glassmorphism Design
 * Author: Dr. Mauricio Villamandos - Psi.Co.Di.Na.M.& C.
 */

/* ==========================================================================
   PANSS Specific Variables
   ========================================================================== */

:root {
    /* PANSS Color Palette */
    --panss-positive: #dc3545;      /* Red for positive symptoms */
    --panss-negative: #6c757d;      /* Gray for negative symptoms */
    --panss-general: #0d6efd;       /* Blue for general psychopathology */
    --panss-composite: #28a745;     /* Green for composite scores */
    
    /* Score Level Colors */
    --score-absent: #e8f5e8;        /* 1 - Absent */
    --score-minimal: #fff3cd;       /* 2 - Minimal */
    --score-mild: #ffeaa7;          /* 3 - Mild */
    --score-moderate: #fab1a0;      /* 4 - Moderate */
    --score-moderate-severe: #fd79a8; /* 5 - Moderate severe */
    --score-severe: #e84393;        /* 6 - Severe */
    --score-extreme: #a29bfe;       /* 7 - Extreme */
}

/* ==========================================================================
   PANSS Hero Section
   ========================================================================== */

.panss-hero {
    background: linear-gradient(135deg, var(--panss-positive) 0%, var(--panss-general) 100%);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.panss-hero-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.panss-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.panss-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.panss-hero-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.panss-meta-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   PANSS Scale Sections
   ========================================================================== */

.panss-scale-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.panss-scale-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.panss-scale-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 1rem;
    box-shadow: var(--shadow-sm);
}

.panss-scale-icon.positive {
    background: linear-gradient(135deg, var(--panss-positive), #e74c3c);
}

.panss-scale-icon.negative {
    background: linear-gradient(135deg, var(--panss-negative), #5a6268);
}

.panss-scale-icon.general {
    background: linear-gradient(135deg, var(--panss-general), #0056b3);
}

.panss-scale-info h3 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.panss-scale-description {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* ==========================================================================
   PANSS Items
   ========================================================================== */

.panss-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.panss-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.panss-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.panss-item-number {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.panss-item-title {
    flex: 1;
    margin-left: 1rem;
}

.panss-item-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.panss-item-definition {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.panss-item-score {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    min-width: 60px;
    justify-content: center;
}

/* ==========================================================================
   PANSS Rating Scale
   ========================================================================== */

.panss-rating-scale {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.panss-rating-option {
    position: relative;
    text-align: center;
}

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

.panss-rating-label {
    display: block;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.panss-rating-value {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.panss-rating-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* Rating Level Styles */
.panss-rating-label.level-1 { border-color: #28a745; }
.panss-rating-label.level-2 { border-color: #6c757d; }
.panss-rating-label.level-3 { border-color: #ffc107; }
.panss-rating-label.level-4 { border-color: #fd7e14; }
.panss-rating-label.level-5 { border-color: #dc3545; }
.panss-rating-label.level-6 { border-color: #6f42c1; }
.panss-rating-label.level-7 { border-color: #e83e8c; }

.panss-rating-option input[type="radio"]:checked + .panss-rating-label {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-1 {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-2 {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-3 {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-4 {
    background: #fd7e14;
    border-color: #fd7e14;
    color: white;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-5 {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-6 {
    background: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

.panss-rating-option input[type="radio"]:checked + .panss-rating-label.level-7 {
    background: #e83e8c;
    border-color: #e83e8c;
    color: white;
}

/* ==========================================================================
   PANSS Results Panel
   ========================================================================== */

.panss-results-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 120px;
}

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

.panss-results-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.panss-subscale-scores {
    margin-bottom: 2rem;
}

.panss-subscale-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.panss-subscale-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.panss-subscale-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.panss-subscale-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panss-subscale-max {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.panss-subscale-card.positive .panss-subscale-value {
    color: var(--panss-positive);
}

.panss-subscale-card.negative .panss-subscale-value {
    color: var(--panss-negative);
}

.panss-subscale-card.general .panss-subscale-value {
    color: var(--panss-general);
}

.panss-total-score {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 2rem;
}

.panss-total-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.panss-total-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panss-total-interpretation {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ==========================================================================
   PANSS Chart Container
   ========================================================================== */

.panss-chart-container {
    margin-bottom: 2rem;
}

.panss-chart-title {
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.panss-chart-wrapper {
    position: relative;
    height: 300px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
}

/* ==========================================================================
   PANSS Action Buttons
   ========================================================================== */

.panss-action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.panss-action-button {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.panss-action-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.panss-action-button--primary {
    background: var(--primary-color);
    color: white;
}

.panss-action-button--primary:hover {
    background: var(--primary-dark);
}

.panss-action-button--secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.panss-action-button--secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

/* ==========================================================================
   PANSS Progress Indicator
   ========================================================================== */

.panss-progress-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.panss-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panss-progress-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panss-progress-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.panss-progress-badge {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.panss-progress-bar-container {
    position: relative;
}

.panss-progress-bar {
    background: linear-gradient(90deg, var(--panss-positive), var(--panss-general));
    transition: width 0.5s ease;
}

/* ==========================================================================
   PANSS Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .panss-rating-scale {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }
    
    .panss-rating-label {
        padding: 0.5rem 0.25rem;
        min-height: 70px;
    }
    
    .panss-rating-value {
        font-size: 1rem;
    }
    
    .panss-rating-text {
        font-size: 0.7rem;
    }
    
    .panss-hero-title {
        font-size: 2rem;
    }
    
    .panss-scale-section {
        padding: 1rem;
    }
    
    .panss-item {
        padding: 1rem;
    }
    
    .panss-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .panss-item-title {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .panss-rating-scale {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .panss-hero-meta {
        flex-direction: column;
        align-items: center;
    }
    
    .panss-action-buttons {
        flex-direction: column;
    }
}

/* ==========================================================================
   PANSS Print Styles
   ========================================================================== */

@media print {
    .panss-results-panel {
        position: static;
        page-break-inside: avoid;
    }
    
    .panss-action-buttons {
        display: none;
    }
    
    .panss-chart-container {
        page-break-inside: avoid;
    }
    
    .panss-scale-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .panss-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ==========================================================================
   Chart.js Radar Chart Custom Styles
   ========================================================================== */

#panssChart {
    max-height: 350px;
    max-width: 100%;
}

.chart-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.chart-card .card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.panss-chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Modular Grid Layout for PANSS Items
   ========================================================================== */

.scale-section {
    margin-bottom: 3rem;
}

.panss-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .panss-items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.panss-item-compact {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition-smooth);
}

.panss-item-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.compact-score {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-sm);
}

.compact-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.compact-rating {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.compact-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.compact-option input[type="radio"] {
    margin-bottom: 0.25rem;
}

.compact-option-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.compact-option-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Enhanced modular design improvements for existing PANSS structure */
.panss-item {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1rem !important;
}

.panss-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.item-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 0.75rem !important;
}

.item-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    flex: 1 !important;
}

.item-score {
    background: var(--primary-gradient) !important;
    color: white !important;
    padding: 0.3rem 0.8rem !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    min-width: 2.5rem !important;
    text-align: center !important;
}

.item-description {
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    margin-bottom: 1rem !important;
    line-height: 1.5 !important;
}

.rating-options {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 0.4rem !important;
    margin-top: 0.5rem !important;
}

.rating-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0.5rem 0.3rem !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-align: center !important;
}

.rating-option:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
}

.rating-option input[type="radio"] {
    display: none !important;
}

.rating-option input[type="radio"]:checked + .rating-label {
    color: white !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    position: relative !important;
}

/* Color coding by severity (1-7 scale) */
.rating-option input[type="radio"][value="1"]:checked + .rating-label {
    background: linear-gradient(135deg, #28a745, #20c997) !important; /* Verde - Ausente */
}

.rating-option input[type="radio"][value="2"]:checked + .rating-label {
    background: linear-gradient(135deg, #20c997, #17a2b8) !important; /* Verde-Azul - Mínimo */
}

.rating-option input[type="radio"][value="3"]:checked + .rating-label {
    background: linear-gradient(135deg, #17a2b8, #007bff) !important; /* Azul - Leve */
}

.rating-option input[type="radio"][value="4"]:checked + .rating-label {
    background: linear-gradient(135deg, #007bff, #6610f2) !important; /* Azul-Púrpura - Moderado */
}

.rating-option input[type="radio"][value="5"]:checked + .rating-label {
    background: linear-gradient(135deg, #6610f2, #fd7e14) !important; /* Púrpura-Naranja - Mod-Severo */
}

.rating-option input[type="radio"][value="6"]:checked + .rating-label {
    background: linear-gradient(135deg, #fd7e14, #dc3545) !important; /* Naranja-Rojo - Severo */
}

.rating-option input[type="radio"][value="7"]:checked + .rating-label {
    background: linear-gradient(135deg, #dc3545, #721c24) !important; /* Rojo-Granate - Extremo */
}

/* Enhanced visual feedback for selected options */
.rating-option input[type="radio"]:checked + .rating-label::before {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    background: rgba(255, 255, 255, 0.4);
    color: #000;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Enhanced item highlighting when option is selected */
.panss-item:has(input[type="radio"]:checked) {
    border-color: rgba(220, 53, 69, 0.6) !important;
    background: rgba(220, 53, 69, 0.08) !important;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.2) !important;
}

.panss-item:has(input[type="radio"]:checked) .item-score {
    background: linear-gradient(135deg, #dc3545, #fd7e14) !important;
    animation: pulse-score 2s infinite;
}

@keyframes pulse-score {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Two-column layout with fixed right panel */
.panss-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.panss-form-column {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding-right: 1rem;
}

.panss-sidebar-column {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 200px);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.panss-sidebar-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.panss-sidebar-header h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.panss-sidebar-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Progress bar styling */
.panss-progress-section {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.panss-progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.panss-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
    border-radius: 20px;
    transition: width 0.6s ease;
    position: relative;
}

.panss-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced chart container for sidebar */
.panss-chart-container {
    margin-bottom: 1.5rem;
}

.panss-chart-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    height: 300px;
}

#panssChart {
    width: 100% !important;
    height: 100% !important;
}

/* Scores summary in sidebar */
.scores-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item:last-child {
    border-bottom: none;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    min-width: 2.5rem;
    text-align: center;
}

.score-positive {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    color: white;
}

.score-negative {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.score-general {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.score-total {
    background: linear-gradient(135deg, #6610f2, #495057);
    color: white;
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .panss-layout {
        grid-template-columns: 1fr 350px;
        gap: 1.5rem;
    }
    
    .panss-sidebar-column {
        position: sticky;
        top: 10px;
    }
}

@media (max-width: 992px) {
    .panss-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .panss-sidebar-column {
        position: relative;
        top: 0;
        max-height: none;
        order: -1;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .panss-form-column {
        max-height: none;
        padding-right: 0;
    }
    
    .panss-chart-wrapper {
        height: 250px;
    }
    
    .panss-sidebar-header h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .panss-layout {
        gap: 0.75rem;
    }
    
    .panss-sidebar-column {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .scores-summary {
        padding: 0.75rem;
    }
    
    .score-item {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1rem;
        padding: 0.2rem 0.6rem;
        min-width: 2rem;
    }
    
    .panss-progress-bar {
        height: 10px;
    }
    
    .panss-chart-wrapper {
        height: 200px;
        padding: 0.75rem;
    }
    
    .panss-sidebar-header {
        margin-bottom: 1rem;
    }
    
    .panss-progress-section {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .glass-card {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .panss-sidebar-column {
        padding: 0.75rem;
    }
    
    .scores-summary {
        padding: 0.5rem;
    }
    
    .score-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .score-value {
        align-self: flex-end;
    }
    
    .panss-chart-wrapper {
        height: 180px;
        padding: 0.5rem;
    }
    
    .rating-options {
        gap: 0.1rem;
    }
    
    .rating-label {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 0.7rem;
    }
    
    .rating-text {
        font-size: 0.6rem;
    }
}

/* Enhanced accessibility and touch targets for mobile */
@media (max-width: 768px) {
    .rating-option {
        min-height: 44px;
        padding: 0.4rem 0.2rem;
    }
    
    .rating-label {
        min-width: 32px;
        min-height: 32px;
    }
}

/* Sticky sidebar behavior optimization */
@media (min-width: 993px) {
    .panss-sidebar-column {
        position: sticky;
        top: 20px;
        height: fit-content;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    .panss-sidebar-column {
        display: none;
    }
    
    .panss-layout {
        grid-template-columns: 1fr;
    }
    
    .action-controls {
        display: none;
    }
}

.rating-label {
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0.3rem !important;
}

.rating-text {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

/* Active/selected item styling */
.panss-item.active {
    border-color: rgba(220, 53, 69, 0.5) !important;
    background: rgba(220, 53, 69, 0.1) !important;
}

.panss-item-score {
    font-weight: 700 !important;
}

/* Section headers enhanced */
.scale-header {
    margin-bottom: 1.5rem !important;
}

.scale-stats {
    display: flex !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap !important;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 0.4rem 1rem !important;
    border-radius: 25px !important;
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Chart visualization improvements */
.panss-chart-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 15px !important;
    padding: 1.5rem !important;
    margin: 1rem 0 !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .rating-options {
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 0.2rem !important;
    }
    
    .rating-label {
        width: 1.6rem !important;
        height: 1.6rem !important;
        font-size: 0.8rem !important;
    }
    
    .rating-text {
        font-size: 0.65rem !important;
    }
    
    .item-title {
        font-size: 1rem !important;
    }
    
    .item-description {
        font-size: 0.85rem !important;
    }
}

/* ==========================================================================
   HCPE Form Styles - DATOS GENERALES Section
   ========================================================================== */

.form-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.form-section h2 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.voice-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.voice-controls .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.voice-controls .btn i {
    margin-right: 0.25rem;
}

/* ==========================================================================
   Responsive Design for HCPE Forms
   ========================================================================== */

@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .form-control {
        padding: 0.625rem;
        font-size: 0.85rem;
    }
    
    .voice-controls {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .voice-controls .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Print Styles for HCPE Forms
   ========================================================================== */

@media print {
    .form-section {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .voice-controls {
        display: none !important;
    }
}