/* Modern Treatment Checklist System - Premium Design */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0066cc;
    --primary-gradient: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    --secondary-color: #2ecc71;
    --secondary-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --bg-surface: #ffffff;
    --bg-bkg: #f8fafc;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#treatment-system-container {
    max-width: 900px;
    margin: 3rem auto;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    background: var(--bg-bkg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Header Section */
.treatment-header {
    background: var(--bg-surface);
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.treatment-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.treatment-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.treatment-header h2 i {
    color: var(--primary-color);
}

.pathology-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Progress Bar */
.progress-container {
    margin-top: 1.5rem;
    background: #f1f5f9;
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--secondary-gradient);
    border-radius: 9999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Session Controls */
.session-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.session-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.session-info span {
    font-weight: 600;
    color: var(--primary-color);
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reset:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #ef4444;
}

/* Categories Grid */
.checklist-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.category-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.category-header {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-icon {
    color: var(--primary-color);
    opacity: 0.8;
}

/* Checklist Items */
.category-items {
    padding: 0.5rem 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

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

.checklist-item:hover {
    background: #f8fafc;
}

.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.custom-checkbox input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    transition: var(--transition);
    display: grid;
    place-items: center;
    background: white;
}

.custom-checkbox input:checked+.checkmark {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: none;
}

.custom-checkbox input:checked+.checkmark::after {
    display: block;
}

.item-label {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.4;
    transition: color 0.2s;
}

.checklist-item input:checked~.item-label {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Actions Footer */
.actions-footer {
    padding: 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    justify-content: center;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
    text-decoration: none;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(37, 211, 102, 0.3);
    background: #22c35e;
}

.btn-whatsapp i {
    font-size: 1.4rem;
}

/* Responsive */
@media (max-width: 768px) {
    #treatment-system-container {
        margin: 1rem;
        border-radius: var(--radius-md);
    }

    .treatment-header {
        padding: 1.5rem;
    }

    .session-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-reset {
        width: 100%;
        justify-content: center;
    }

    .checklist-categories {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }


    .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }
}

/* Modal de WhatsApp */
.treatment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.treatment-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.treatment-modal {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.treatment-modal-overlay.active .treatment-modal {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #25D366 0%, #22c35e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.modal-icon i {
    font-size: 2.5rem;
    color: white;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin: 0 0 0.75rem 0;
}

.modal-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.patient-name-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.patient-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.patient-input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.patient-input::placeholder {
    color: #94a3b8;
}

.phone-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.country-code {
    width: 80px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    background: #f8fafc;
    color: var(--text-main);
    cursor: not-allowed;
}

.phone-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.phone-input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.phone-input::placeholder {
    color: #94a3b8;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.btn-cancel {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.btn-confirm {
    background: linear-gradient(135deg, #25D366 0%, #22c35e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

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

/* Responsive para modal */
@media (max-width: 768px) {
    .treatment-modal {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .modal-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1.25rem;
    }

    .modal-icon i {
        font-size: 2rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-desc {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .patient-name-group {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .patient-input {
        width: 100%;
    }

    .phone-input-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .country-code {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }
}
/* Info Toggles & Video Links */
.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
}

.info-toggle, .edit-video-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.4rem;
    transition: var(--transition);
    opacity: 0.6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-toggle {
    color: var(--primary-color);
}

.edit-video-btn {
    color: #64748b;
}

.info-toggle:hover, .edit-video-btn:hover {
    transform: scale(1.15);
    opacity: 1;
    background: #f1f5f9;
}

.edit-video-btn:hover {
    color: var(--primary-color);
}

.item-info {
    padding: 0.5rem 1.25rem 1rem 3.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease-out;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
}

.item-info.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom: none;
}

.info-description {
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.info-video {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #FF0000;
    font-weight: 600;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.info-video:hover {
    background: #fef2f2;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.video-url-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 1rem;
}

.video-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

@media (max-width: 768px) {
  .item-info {
      padding-left: 1.25rem;
  }
}

/* Therapy Sections Reorganization */
.checklist-main-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.therapy-section {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.therapy-section-header {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.therapy-section-header i {
    font-size: 1.5rem;
}

.therapy-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Passive Therapy (Blue Theme) */
.passive-therapy {
    border-color: #bfdbfe;
}

.passive-therapy .therapy-section-header {
    background: linear-gradient(to right, #eff6ff, white);
    color: #1e40af;
    border-bottom-color: #bfdbfe;
}

.passive-therapy .therapy-section-header i {
    color: #3b82f6;
}

/* Active Therapy (Green Theme) */
.active-therapy {
    border-color: #bbf7d0;
}

.active-therapy .therapy-section-header {
    background: linear-gradient(to right, #f0fdf4, white);
    color: #166534;
    border-bottom-color: #bbf7d0;
}

.active-therapy .therapy-section-header i {
    color: #22c55e;
}

/* Adjust grid inside sections */
.therapy-section .checklist-categories {
    padding: 1.5rem;
    background: transparent;
}

@media (max-width: 768px) {
    .checklist-main-content {
        padding: 1rem;
        gap: 2rem;
    }
    
    .therapy-section-header {
        padding: 1.25rem;
    }
    
    .therapy-section .checklist-categories {
        padding: 1rem;
    }
}
