/* ============================================
   BEACON PAIN CLINIC - TREATMENTS PAGE
   ============================================ */

/* ============================================
   PAGE WRAPPER & CORE VARIABLES
   ============================================ */
.treatments-page-wrapper {
    width: 100%;
    position: relative;
    background: transparent;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    
    /* CSS Variables */
    --treat-primary: #1a5e8f;
    --treat-secondary: #2c78b0;
    --treat-accent: #3498db;
    --treat-accent-light: rgba(52, 152, 219, 0.1);
    --treat-success: #22c55e;
    --treat-warning: #f59e0b;
    --treat-danger: #ef4444;
    --treat-bg-white: #ffffff;
    --treat-bg-light: #f8fafc;
    --treat-text-primary: #1e293b;
    --treat-text-secondary: #64748b;
    --treat-text-muted: #94a3b8;
    --treat-border: #e2e8f0;
    --treat-radius-sm: 0.375rem;
    --treat-radius-lg: 0.5rem;
    --treat-radius-xl: 0.75rem;
    --treat-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --treat-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --treat-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --treat-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --treat-transition: all 0.3s ease;
}

/* Mobile overflow fix */
@media (max-width: 480px) {
    *, *::before, *::after {
        box-sizing: border-box;
    }
    
    .treatments-page-wrapper {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* ============================================
   MAIN HEADER SECTION
   ============================================ */
.treatments-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--treat-bg-light) 0%, #f0f9ff 100%);
    width: 100%;
}

.treatments-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.treat-section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--treat-primary);
    margin-bottom: 1rem;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .treatments-section { padding: 3rem 0; }
    .treatments-container { padding: 0 0.75rem; }
    .treat-section-title { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .treatments-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ============================================
   SEARCH FUNCTIONALITY
   ============================================ */
.treatments-search {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid #d1d9e0;
    border-radius: 16px;
    font-size: 1.0625rem;
    font-family: inherit;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-input:focus {
    outline: none;
    border-color: #5ba3d0;
    box-shadow: 0 2px 16px rgba(91,163,208,0.18);
}

.search-input::placeholder {
    color: #94a3b8;
    font-size: 0.9375rem;
}

.search-icon {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.125rem;
    pointer-events: none;
}

.search-input:focus + .search-icon {
    color: #5ba3d0;
}

@media (max-width: 768px) {
    .search-container {
        max-width: 500px;
    }
}

/* ============================================
   FILTER SYSTEM
   ============================================ */
.treatments-filter {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
}

.filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 500px;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 80px;
    justify-content: center;
}

.filter-btn i {
    font-size: 1.5rem;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 94, 143, 0.15);
    border-color: #1a5e8f;
    color: #1a5e8f;
}

.filter-btn:hover i {
    transform: scale(1.1);
    color: #1a5e8f;
}

.filter-btn.active {
    background: linear-gradient(135deg, #1a5e8f 0%, #2c78b0 100%);
    color: white;
    border-color: #1a5e8f;
    box-shadow: 0 8px 25px rgba(26, 94, 143, 0.3);
    transform: translateY(-1px);
}

.filter-btn.active i {
    color: white;
    transform: scale(1.1);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(26, 94, 143, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.filter-btn:active::before {
    width: 100%;
    height: 100%;
}

/* Icon colors */
.filter-btn[data-filter="all"] i { color: #6366f1; }
.filter-btn[data-filter="injections"] i { color: #ef4444; }
.filter-btn[data-filter="stimulation"] i { color: #f59e0b; }
.filter-btn[data-filter="minimally-invasive"] i { color: #10b981; }
.filter-btn[data-filter="therapy"] i { color: #8b5cf6; }

.filter-btn:not(.active):hover[data-filter="all"] i { color: #6366f1; }
.filter-btn:not(.active):hover[data-filter="injections"] i { color: #ef4444; }
.filter-btn:not(.active):hover[data-filter="stimulation"] i { color: #f59e0b; }
.filter-btn:not(.active):hover[data-filter="minimally-invasive"] i { color: #10b981; }
.filter-btn:not(.active):hover[data-filter="therapy"] i { color: #8b5cf6; }

.filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 94, 143, 0.3);
}

/* Filter responsive */
@media (max-width: 768px) {
    .treatments-header {
        margin-bottom: 1rem;
    }

    .treatments-filter {
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .treatments-filter {
        display: none;
    }
    
    .filter-btn i {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .treat-section-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

@media (min-width: 640px) {
    .filter-tabs {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .filter-tabs {
        grid-template-columns: repeat(5, 1fr);
        max-width: 800px;
        gap: 1rem;
    }
    
    .filter-btn {
        min-height: 90px;
        padding: 1.25rem 1rem;
    }
    
    .filter-btn i {
        font-size: 1.75rem;
    }
}

/* ============================================
   TREATMENT CARDS GRID
   ============================================ */
.treatments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
    width: 100%;
}

.treatment-card {
    background: var(--treat-bg-white);
    border-radius: var(--treat-radius-xl);
    box-shadow: var(--treat-shadow-md);
    overflow: hidden;
    transition: var(--treat-transition);
    border: none;
    position: relative;
    width: 100%;
    min-height: auto;
    opacity: 1;
    transform: scale(1);
}

.treatment-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--treat-shadow-xl);
}

/* Mobile card interactions */
@media (max-width: 768px) {
    .treatment-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .treatment-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .treatment-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--treat-shadow-lg);
    }
    
    .learn-more-btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }
    
    .treatment-card .card-content {
        padding: 0 1.5rem;
    }
    
    .treatment-card .card-header {
        padding: 1.5rem 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .treatments-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .treatment-card:active {
        transform: scale(0.96);
    }
}

.treatment-card.hiding {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.treatment-card.showing {
    opacity: 1;
    transform: scale(1);
}

.card-header {
    position: relative;
    padding: 2rem 2rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.treatment-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--treat-primary), var(--treat-secondary));
    border-radius: var(--treat-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.treatment-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--treat-radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    display: none; /* Temporarily disabled */
}

.treatment-badge.popular { background: var(--treat-warning); color: white; }
.treatment-badge.effective { background: var(--treat-success); color: white; }
.treatment-badge.innovative { background: var(--treat-accent); color: white; }
.treatment-badge.advanced { background: var(--treat-danger); color: white; }
.treatment-badge.regenerative { background: #8b5cf6; color: white; }
.treatment-badge.comprehensive { background: #06b6d4; color: white; }
.treatment-badge.holistic { background: #10b981; color: white; }
.treatment-badge.breakthrough { background: #f59e0b; color: white; }
.treatment-badge.specialised { background: #7c3aed; color: white; }

.card-content {
    padding: 0 2rem;
}

.treatment-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--treat-primary);
    margin-bottom: 1rem;
}

.treatment-description {
    color: var(--treat-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.treatment-features {
    margin-bottom: 1.5rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--treat-text-secondary);
}

.feature .tick {
    color: var(--treat-success);
    font-size: 0.875rem;
    flex-shrink: 0;
    font-weight: bold;
}

.treatment-conditions {
    display: none; /* Hidden from main card view */
    margin-bottom: 1.5rem;
}

.conditions-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--treat-primary);
    margin-bottom: 0.5rem;
}

.conditions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.condition-tag {
    background: var(--treat-accent-light);
    color: var(--treat-primary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--treat-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.treatment-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--treat-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--treat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-footer {
    padding: 1.5rem 2rem 2rem;
}

.learn-more-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border: 2px solid var(--treat-primary);
    background: transparent;
    color: var(--treat-primary);
    border-radius: var(--treat-radius-lg);
    font-weight: 600;
    transition: var(--treat-transition);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.learn-more-btn:hover {
    background: var(--treat-primary);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Cards responsive */
@media (max-width: 900px) {
    .treatments-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }
}

@media (max-width: 768px) {
    .treatment-stats { 
        gap: 1rem; 
        flex-direction: column; 
        align-items: flex-start; 
    }
    
    .stat { 
        text-align: left; 
        display: flex; 
        align-items: center; 
        gap: 0.5rem; 
    }
    
    .stat-number, .stat-label { 
        display: inline; 
        margin: 0; 
    }
    
    .treatment-icon { 
        width: 3rem; 
        height: 3rem; 
        font-size: 1.25rem; 
    }
    
    .treatment-title { 
        font-size: 1.25rem; 
    }
}

@media (max-width: 480px) {
    .treatments-grid {
        max-width: 100%;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-header { 
        padding: 1.5rem 1.5rem 1rem; 
        flex-direction: column; 
        gap: 1rem; 
        align-items: center; 
        text-align: center; 
    }
    
    .card-content { 
        padding: 0 1.5rem; 
    }
    
    .card-footer { 
        padding: 1rem 1.5rem 1.5rem; 
    }
    
    .treatment-badge { 
        order: -1; 
    }
}

/* ============================================
   CALL TO ACTION SECTION
   ============================================ */
.treatments-cta {
    background: var(--treat-bg-white);
    border-radius: var(--treat-radius-xl);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--treat-shadow-lg);
    border: none;
    width: 100%;
}

.cta-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--treat-primary);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.125rem;
    color: var(--treat-text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.treat-btn-primary,
.treat-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--treat-radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--treat-transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.treat-btn-primary {
    background: linear-gradient(135deg, var(--treat-primary), var(--treat-secondary));
    color: white;
    box-shadow: var(--treat-shadow-md);
}

.treat-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--treat-shadow-lg);
    color: white;
    text-decoration: none;
}

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

.treat-btn-secondary:hover {
    background: var(--treat-primary);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

.cta-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--treat-text-muted);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .treatments-cta { 
        padding: 2rem 1.5rem; 
    }
    
    .cta-content h3 { 
        font-size: 1.5rem; 
    }
    
    .cta-content p { 
        font-size: 1rem; 
    }
    
    .cta-buttons { 
        flex-direction: column; 
        align-items: center; 
    }
    
    .treat-btn-primary, .treat-btn-secondary { 
        width: 100%; 
        max-width: 300px; 
    }
}

@media (max-width: 480px) {
    .treatments-cta { 
        padding: 1.5rem 1rem; 
    }
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
/* Hide progress line when modal is active */
.treatment-modal.active ~ * .progress-line,
.treatment-modal.active ~ * .progress-bar,
.treatment-modal.active ~ * [class*="progress"],
body:has(.treatment-modal.active) .progress-line,
body:has(.treatment-modal.active) .progress-bar,
body:has(.treatment-modal.active) [class*="progress"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.treatment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: var(--treat-radius-xl);
    box-shadow: var(--treat-shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 2001;
    transform: scale(0.9);
    opacity: 0;
    transition: var(--treat-transition);
}

.treatment-modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--treat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--treat-primary);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--treat-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--treat-transition);
}

.modal-close:hover {
    background: var(--treat-bg-light);
    color: var(--treat-text-primary);
}

.modal-body {
    padding: 2rem;
    line-height: 1.6;
}

.modal-body h4 {
    color: var(--treat-primary);
    font-weight: 600;
    margin: 1.5rem 0 0.5rem 0;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ul,
.modal-body ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.modal-body li {
    margin-bottom: 0.25rem;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--treat-border);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.treat-btn-print {
    background: var(--treat-accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--treat-radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--treat-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    min-width: 120px;
}

.treat-btn-print:hover {
    background: var(--treat-secondary);
    transform: translateY(-2px);
    box-shadow: var(--treat-shadow-md);
}

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

@media (max-width: 768px) {
    .modal-content { 
        margin: 0; 
        border-radius: 0; 
        max-height: 100vh; 
        height: 100vh; 
        max-width: 100%; 
    }
    
    .modal-footer { 
        flex-direction: column; 
    }
    
    .modal-footer .treat-btn-primary, 
    .modal-footer .treat-btn-secondary,
    .modal-footer .treat-btn-print { 
        width: 100%; 
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .modal-header { 
        padding: 1.5rem 1.5rem 1rem; 
    }
    
    .modal-body { 
        padding: 1.5rem; 
    }
    
    .modal-footer { 
        padding: 1rem 1.5rem 1.5rem; 
    }
}

/* ============================================
   RIPPLE ANIMATION
   ============================================ */
@keyframes treat-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .treatment-card,
    .filter-btn,
    .fade-in {
        animation: none !important;
        transition: none !important;
    }
    
    .treatment-card,
    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}
