/* =============================================
   ENHANCED ACTION PROTOCOL STYLES
   Add this to your aeci-report-sections.css file
   or create a new file: aeci-action-protocols.css
   ============================================= */

/* Main container */
.action-protocol {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

/* Immediate Actions Section */
.action-protocol .immediate-actions {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 4px solid #f97316;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.action-protocol .immediate-actions h5 {
    color: #c2410c;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.action-protocol .immediate-actions ul {
    margin: 0;
    padding-left: 20px;
}

.action-protocol .immediate-actions li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #7c2d12;
}

/* Weekly Protocol Section */
.action-protocol .weekly-protocol {
    margin-bottom: 20px;
}

.action-protocol .weekly-protocol > h5 {
    color: #26366B;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #26366B;
    padding-bottom: 8px;
}

/* Individual Week Block */
.action-protocol .week-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.action-protocol .week-block h6 {
    color: #26366B;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(90deg, #f1f5f9 0%, transparent 100%);
    padding: 8px 12px;
    margin: -15px -20px 15px -20px;
    border-radius: 7px 7px 0 0;
}

/* Daily Schedule */
.action-protocol .daily-schedule {
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.action-protocol .daily-schedule p {
    margin: 0 0 8px 0;
    line-height: 1.5;
    font-size: 14px;
}

.action-protocol .daily-schedule p:last-child {
    margin-bottom: 0;
}

.action-protocol .daily-schedule strong {
    color: #475569;
}

/* Tools Needed */
.action-protocol .tools-needed {
    margin-bottom: 12px;
}

.action-protocol .tools-needed p {
    margin: 0 0 6px 0;
    font-size: 14px;
}

.action-protocol .tools-needed ul {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
}

.action-protocol .tools-needed li {
    font-size: 13px;
    color: #64748b;
}

/* Expected Experience */
.action-protocol .expected-experience {
    font-size: 14px;
    margin: 10px 0;
    padding: 8px 12px;
    background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 4px;
    color: #065f46;
}

.action-protocol .expected-experience em {
    font-style: normal;
}

/* Troubleshooting */
.action-protocol .troubleshooting {
    background: #fffbeb;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
    margin-top: 12px;
}

.action-protocol .troubleshooting p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.action-protocol .troubleshooting ul {
    margin: 0;
    padding-left: 20px;
}

.action-protocol .troubleshooting li {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Red Flags Section */
.action-protocol .red-flags {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #dc2626;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

.action-protocol .red-flags h5 {
    color: #b91c1c;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
}

.action-protocol .red-flags ul {
    margin: 0;
    padding-left: 20px;
}

.action-protocol .red-flags li {
    margin-bottom: 8px;
    line-height: 1.4;
    color: #7f1d1d;
    font-size: 14px;
}

/* Research Backing Section */
.action-protocol .research-backing {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.action-protocol .research-backing details {
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px 15px;
}

.action-protocol .research-backing summary {
    cursor: pointer;
    color: #475569;
    font-size: 14px;
}

.action-protocol .research-backing summary:hover {
    color: #26366B;
}

.action-protocol .research-backing ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.action-protocol .research-backing li {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    margin-bottom: 5px;
}

/* Pending Message */
.protocol-pending {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Print Styles */
@media print {
    .action-protocol {
        background: white;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .action-protocol .week-block {
        page-break-inside: avoid;
    }
    
    .action-protocol .research-backing details {
        display: block;
    }
    
    .action-protocol .research-backing summary {
        display: none;
    }
    
    .action-protocol .research-backing ul {
        display: block;
    }
}

/* =============================================
   Question-Centric Protocol Styles
   ============================================= */

.action-protocol.question-centric {
    padding: 0;
    font-family: inherit;
}

.priority-focus-areas {
    margin-bottom: 30px;
}

.protocol-intro {
    color: #666;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Question Protocol Card */
.question-protocol {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 28px;
    border-left: 5px solid #26366B;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.question-protocol.priority-critical {
    border-left-color: #DC2626;
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 100%);
}

.question-protocol.priority-low {
    border-left-color: #F59E0B;
    background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%);
}

.question-protocol.priority-moderate {
    border-left-color: #3B82F6;
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
}

.question-protocol.priority-high {
    border-left-color: #10B981;
    background: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 100%);
}

/* Header */
.question-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.question-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #1F2937;
    font-weight: 600;
    line-height: 1.4;
}

.measures-label {
    margin: 0;
    font-size: 0.85rem;
    color: #6B7280;
    font-style: italic;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-critical .priority-badge {
    background: #FEE2E2;
    color: #DC2626;
}

.priority-low .priority-badge {
    background: #FEF3C7;
    color: #D97706;
}

.priority-moderate .priority-badge {
    background: #DBEAFE;
    color: #2563EB;
}

.priority-high .priority-badge {
    background: #D1FAE5;
    color: #059669;
}

.score-badge {
    background: #F3F4F6;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4B5563;
    font-weight: 600;
}

/* Immediate Action Box */
.immediate-action-box {
    background: linear-gradient(135deg, #26366B 0%, #1e2a52 100%);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.immediate-action-box h6 {
    color: #FFD700;
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.immediate-action-box p {
    margin: 0;
    line-height: 1.7;
    font-size: 0.95rem;
    color: #ffffff !important;
}

/* Weekly Protocol Container */
.weekly-protocol-container {
    margin-top: 20px;
}

.weekly-protocol-title {
    color: #26366B;
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Week Block (Collapsible) */
.week-block-details {
    background: #F9FAFB;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.week-block-details[open] {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.week-summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    color: #26366B;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-summary::-webkit-details-marker {
    display: none;
}

.week-summary::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.week-block-details[open] .week-summary::before {
    transform: rotate(90deg);
}

.week-summary:hover {
    background: #F3F4F6;
}

.week-content {
    padding: 0 18px 18px 18px;
}

/* Daily Schedule */
.daily-schedule {
    margin-bottom: 16px;
}

.schedule-block {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #E5E7EB;
}

.schedule-block strong {
    display: block;
    margin-bottom: 6px;
    color: #26366B;
    font-size: 0.9rem;
}

.schedule-block p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4B5563;
}

.schedule-morning { border-left: 3px solid #F59E0B; }
.schedule-midday { border-left: 3px solid #3B82F6; }
.schedule-evening { border-left: 3px solid #8B5CF6; }

/* Tools Needed */
.tools-needed {
    background: #EFF6FF;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #1E40AF;
}

.tools-needed strong {
    color: #1E3A8A;
}

/* Expected Experience */
.expected-experience {
    background: #F0FDF4;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-left: 3px solid #10B981;
}

.expected-experience strong {
    display: block;
    margin-bottom: 6px;
    color: #065F46;
    font-size: 0.9rem;
}

.expected-experience p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #047857;
}

/* Troubleshooting */
.troubleshooting {
    background: #FEF3C7;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.troubleshooting strong {
    display: block;
    margin-bottom: 8px;
    color: #92400E;
    font-size: 0.9rem;
}

.troubleshooting ul {
    margin: 0;
    padding-left: 18px;
}

.troubleshooting li {
    font-size: 0.85rem;
    margin: 8px 0;
    line-height: 1.6;
    color: #78350F;
}

/* Application Note (Context-Specific) */
.application-note {
    background: linear-gradient(135deg, #EDE9FE 0%, #F5F3FF 100%);
    padding: 14px;
    border-radius: 8px;
    border-left: 3px solid #7C3AED;
}

.application-note strong {
    display: block;
    margin-bottom: 6px;
    color: #5B21B6;
    font-size: 0.9rem;
}

.application-note p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6D28D9;
}

/* Expected Results Timeline */
.expected-results-timeline {
    margin-top: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 10px;
}

.expected-results-timeline h6 {
    margin: 0 0 14px 0;
    color: #26366B;
    font-size: 0.95rem;
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.timeline-week {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    text-align: center;
}

.week-label {
    display: block;
    font-weight: 600;
    color: #26366B;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.timeline-week p {
    margin: 0;
    font-size: 0.8rem;
    color: #6B7280;
    line-height: 1.5;
}

/* Red Flags */
.red-flags-section {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 12px;
    padding: 20px;
    margin-top: 28px;
}

.red-flags-section h5 {
    color: #DC2626;
    margin: 0 0 14px 0;
    font-size: 1rem;
}

.red-flags-section ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.red-flags-section li {
    padding: 10px 0;
    border-bottom: 1px solid #FECACA;
    font-size: 0.9rem;
    color: #7F1D1D;
}

.red-flags-section li:last-child {
    border-bottom: none;
}

.red-flags-section li em {
    display: block;
    margin-top: 4px;
    color: #991B1B;
    font-size: 0.85rem;
}

/* Research Backing */
.research-backing-section {
    margin-top: 24px;
}

.research-backing-section details {
    background: #F9FAFB;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
}

.research-backing-section summary {
    padding: 14px 18px;
    cursor: pointer;
    color: #26366B;
}

.research-backing-section summary:hover {
    background: #F3F4F6;
}

.research-backing-section ul {
    margin: 0;
    padding: 0 18px 18px 36px;
}

.research-backing-section li {
    font-size: 0.85rem;
    color: #6B7280;
    margin: 10px 0;
    line-height: 1.5;
}

/* All High Message */
.all-high-message {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid #A7F3D0;
}

.all-high-message p {
    margin: 0;
    color: #065F46;
    font-size: 1rem;
    line-height: 1.6;
}

/* Legacy Mode */
.action-protocol.legacy-mode {
    opacity: 0.9;
}

/* Protocol Pending */
.protocol-pending {
    background: #F3F4F6;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #6B7280;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .question-protocol {
        padding: 18px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .schedule-block {
        padding: 10px 12px;
    }
    
    .week-content {
        padding: 0 14px 14px 14px;
    }
}

@media print {
    .week-block-details {
        break-inside: avoid;
    }
    
    .week-block-details[open] .week-summary::before {
        display: none;
    }
}