/**
 * LTC Rehabilitation Sections Styles
 * For Extended Care and Medical Rehabilitation
 * 
 * @package Smart_Hospital
 */

/* ========================================
   Shift Review Banner
======================================== */
.shift-review-banner {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.shift-review-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shift-review-banner .banner-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shift-review-banner .banner-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.shift-review-banner .banner-text strong {
    display: block;
    font-size: 0.95rem;
}

/* ========================================
   LTC Section Cards
======================================== */
.ltc-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ltc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ltc-section-header:hover {
    background: #f8fafc;
}

.ltc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    margin: 0;
}

.ltc-section-title .section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ltc-section-title .section-icon.icon-assessment {
    background: #dbeafe;
    color: #2563eb;
}

.ltc-section-title .section-icon.icon-goal {
    background: #d1fae5;
    color: #059669;
}

.ltc-section-title .section-icon.icon-adl {
    background: #fef3c7;
    color: #d97706;
}

.ltc-section-title .section-icon.icon-nursing {
    background: #fce7f3;
    color: #db2777;
}

.ltc-section-title .section-icon.icon-therapy {
    background: #e0e7ff;
    color: #4f46e5;
}

.ltc-section-title .section-icon.icon-safety {
    background: #fee2e2;
    color: #dc2626;
}

.ltc-section-title .section-icon.icon-family {
    background: #f3e8ff;
    color: #9333ea;
}

.ltc-section-title .section-icon.icon-progress {
    background: #ccfbf1;
    color: #0d9488;
}

.ltc-section-title .section-icon.icon-next {
    background: #fef9c3;
    color: #ca8a04;
}

.ltc-section-title .section-icon.icon-discharge {
    background: #cffafe;
    color: #0891b2;
}

.ltc-section-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ltc-section-toggle:hover {
    background: #e2e8f0;
}

.ltc-section-toggle svg {
    transition: transform 0.3s ease;
}

.ltc-section.collapsed .ltc-section-toggle svg {
    transform: rotate(-90deg);
}

.ltc-section-body {
    padding: 16px;
    display: block;
}

.ltc-section.collapsed .ltc-section-body {
    display: none;
}

/* ========================================
   Functional Assessment (Barthel/FIM)
======================================== */
.assessment-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.score-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.score-card .score-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.score-card .score-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.score-card .score-max {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 600;
}

.score-card .score-interpretation {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.score-card .score-interpretation.severe {
    background: #fee2e2;
    color: #dc2626;
}

.score-card .score-interpretation.moderate {
    background: #fef3c7;
    color: #d97706;
}

.score-card .score-interpretation.mild {
    background: #d1fae5;
    color: #059669;
}

.score-card .score-interpretation.independent {
    background: #dbeafe;
    color: #2563eb;
}

.assessment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.dependency-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ========================================
   Independence Goal
======================================== */
.goal-highlight {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.goal-highlight .goal-icon {
    width: 48px;
    height: 48px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.goal-highlight .goal-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #064e3b;
    margin-bottom: 12px;
    line-height: 1.5;
}

.goal-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.goal-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.goal-detail-item .detail-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
}

.goal-detail-item .detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #065f46;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ========================================
   ADL Status Grid
======================================== */
.adl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.adl-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.adl-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.adl-item .adl-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adl-item .adl-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.adl-item .adl-level {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.adl-item.level-independent .adl-icon {
    background: #d1fae5;
    color: #059669;
}
.adl-item.level-independent .adl-level {
    background: #d1fae5;
    color: #059669;
}

.adl-item.level-supervision .adl-icon {
    background: #dbeafe;
    color: #2563eb;
}
.adl-item.level-supervision .adl-level {
    background: #dbeafe;
    color: #2563eb;
}

.adl-item.level-assistance .adl-icon {
    background: #fef3c7;
    color: #d97706;
}
.adl-item.level-assistance .adl-level {
    background: #fef3c7;
    color: #d97706;
}

.adl-item.level-dependent .adl-icon {
    background: #fee2e2;
    color: #dc2626;
}
.adl-item.level-dependent .adl-level {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   Nursing Limits
======================================== */
.nursing-limits-grid {
    display: grid;
    gap: 12px;
}

.limit-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
}

.limit-card.allowed {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.limit-card.restricted {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.limit-card .limit-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.limit-card.allowed .limit-icon {
    background: #10b981;
    color: white;
}

.limit-card.restricted .limit-icon {
    background: #ef4444;
    color: white;
}

.limit-card .limit-content {
    flex: 1;
}

.limit-card .limit-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.limit-card.allowed .limit-title {
    color: #065f46;
}

.limit-card.restricted .limit-title {
    color: #991b1b;
}

.limit-card .limit-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ========================================
   Team Interventions
======================================== */
.team-interventions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intervention-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    border-right: 4px solid;
}

.intervention-card.pt {
    border-color: #8b5cf6;
}

.intervention-card.ot {
    border-color: #f59e0b;
}

.intervention-card.st {
    border-color: #06b6d4;
}

.intervention-card .team-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.intervention-card.pt .team-badge {
    background: #ede9fe;
    color: #7c3aed;
}

.intervention-card.ot .team-badge {
    background: #fef3c7;
    color: #d97706;
}

.intervention-card.st .team-badge {
    background: #cffafe;
    color: #0891b2;
}

.intervention-card .intervention-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
    margin-bottom: 8px;
}

.intervention-card .nursing-tasks {
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
}

.intervention-card .nursing-tasks .tasks-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}

.intervention-card .task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #374151;
    padding: 4px 0;
}

.intervention-card .task-item svg {
    color: #10b981;
    flex-shrink: 0;
}

/* ========================================
   Safety Risks
======================================== */
.safety-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.safety-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
}

.safety-alert.high {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.safety-alert.medium {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.safety-alert.low {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.safety-alert .alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.safety-alert.high .alert-icon {
    background: #ef4444;
    color: white;
}

.safety-alert.medium .alert-icon {
    background: #f59e0b;
    color: white;
}

.safety-alert.low .alert-icon {
    background: #22c55e;
    color: white;
}

.safety-alert .alert-content {
    flex: 1;
}

.safety-alert .alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.safety-alert.high .alert-title {
    color: #991b1b;
}

.safety-alert.medium .alert-title {
    color: #92400e;
}

.safety-alert.low .alert-title {
    color: #166534;
}

.safety-alert .alert-details {
    font-size: 0.85rem;
    color: #6b7280;
}

.safety-devices {
    margin-top: 12px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.safety-devices .devices-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.devices-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.device-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.device-tag svg {
    color: #6366f1;
}

/* ========================================
   Patient & Family Engagement
======================================== */
.engagement-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.engagement-metric {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.engagement-metric .metric-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
}

.engagement-metric .metric-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.engagement-metric .metric-value.high {
    color: #059669;
}

.engagement-metric .metric-value.medium {
    color: #d97706;
}

.engagement-metric .metric-value.low {
    color: #dc2626;
}

.family-support {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    padding: 14px;
}

.family-support .support-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.family-support .support-header svg {
    color: #9333ea;
}

.family-support .support-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #581c87;
}

.family-support .support-details {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ========================================
   Daily Progress
======================================== */
.progress-timeline {
    position: relative;
    padding-right: 20px;
}

.progress-timeline::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.progress-entry {
    position: relative;
    padding: 12px 24px 12px 0;
    margin-bottom: 8px;
}

.progress-entry::before {
    content: '';
    position: absolute;
    right: 0;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid;
}

.progress-entry.achievement::before {
    border-color: #10b981;
}

.progress-entry.barrier::before {
    border-color: #f59e0b;
}

.progress-entry .entry-content {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
}

.progress-entry .entry-time {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.progress-entry .entry-text {
    font-size: 0.9rem;
    color: #1f2937;
    line-height: 1.5;
}

.progress-entry .entry-type {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.progress-entry.achievement .entry-type {
    background: #d1fae5;
    color: #059669;
}

.progress-entry.barrier .entry-type {
    background: #fef3c7;
    color: #d97706;
}

.progress-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.progress-summary .summary-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #166534;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-summary .summary-text {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
}

/* ========================================
   Next Step
======================================== */
.next-step-card {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 2px solid #facc15;
    border-radius: 12px;
    padding: 20px;
}

.next-step-card .step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.next-step-card .step-icon {
    width: 44px;
    height: 44px;
    background: #facc15;
    color: #713f12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-step-card .step-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #713f12;
}

.next-step-card .step-action {
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.6;
    margin-bottom: 14px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.next-step-card .step-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.next-step-card .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #78716c;
}

.next-step-card .meta-item svg {
    color: #a3a3a3;
}

.next-step-card .meta-value {
    font-weight: 600;
    color: #44403c;
}

/* ========================================
   Discharge Readiness
======================================== */
.discharge-progress {
    margin-bottom: 16px;
}

.discharge-progress .progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.discharge-progress .progress-label span:first-child {
    color: #64748b;
}

.discharge-progress .progress-label span:last-child {
    font-weight: 700;
    color: #0891b2;
}

.discharge-progress .progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.discharge-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.discharge-gaps {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 14px;
}

.discharge-gaps .gaps-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.discharge-gaps .gaps-header svg {
    color: #ea580c;
}

.discharge-gaps .gaps-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #9a3412;
}

.gaps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gap-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #374151;
}

.gap-item .gap-icon {
    width: 24px;
    height: 24px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.discharge-target {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    background: #ecfeff;
    border-radius: 10px;
    font-size: 0.9rem;
}

.discharge-target svg {
    color: #0891b2;
}

.discharge-target .target-label {
    color: #64748b;
}

.discharge-target .target-date {
    font-weight: 700;
    color: #0e7490;
}

/* ========================================
   Editable Fields
======================================== */
.editable-field {
    position: relative;
}

.edit-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
    opacity: 0;
}

.editable-field:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    background: #f1f5f9;
    color: #3b82f6;
    border-color: #3b82f6;
}

/* ========================================
   Empty State
======================================== */
.ltc-empty-state {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
}

.ltc-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ltc-empty-state p {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.ltc-empty-state .btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ltc-empty-state .btn-add:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ========================================
   Quick Update Button
======================================== */
.quick-update-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-update-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #475569;
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 480px) {
    .assessment-scores {
        grid-template-columns: 1fr;
    }
    
    .engagement-metrics {
        grid-template-columns: 1fr;
    }
    
    .goal-details {
        flex-direction: column;
        align-items: center;
    }
    
    .adl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* RTL Support */
[dir="rtl"] .progress-timeline {
    padding-right: 0;
    padding-left: 20px;
}

[dir="rtl"] .progress-timeline::before {
    right: auto;
    left: 6px;
}

[dir="rtl"] .progress-entry {
    padding: 12px 0 12px 24px;
}

[dir="rtl"] .progress-entry::before {
    right: auto;
    left: 0;
}

[dir="rtl"] .intervention-card {
    border-right: none;
    border-left: 4px solid;
}

[dir="rtl"] .edit-btn {
    left: auto;
    right: 8px;
}
