/* ===========================
   REHABILITATION - rehabilitation.css
   =========================== */

.rehabilitation {
    padding: 80px 0;
    background-color: var(--white);
}

/* ===========================
   ВАЖЛИВА ПРИМІТКА
   =========================== */

.important-note {
    max-width: 900px;
    margin: 0 auto 50px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #e9f5e3 0%, #f0f8ed 100%);
    border-left: 4px solid #91d072;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.7;
    color: #2c3e50;
}

.important-note strong {
    color: #5fa83b;
    font-weight: 700;
}

/* ===========================
   ТАБЛИЦЯ РЕАБІЛІТАЦІЇ - ДЕСКТОП
   =========================== */

.rehab-table-wrapper {
    overflow-x: auto;
    margin-top: 30px;
}

.rehab-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

/* Заголовки таблиці */
.rehab-table thead th {
    background: #2c3e50;
    color: white;
    padding: 18px 20px;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rehab-table thead th:first-child {
    border-radius: 12px 0 0 12px;
}

.rehab-table thead th:last-child {
    border-radius: 0 12px 12px 0;
}

.rehab-table:not(.rehab-table--overview) thead th:first-child { width: 28%; }
.rehab-table:not(.rehab-table--overview) thead th:nth-child(2) { width: 14%; }
.rehab-table:not(.rehab-table--overview) thead th:nth-child(3) { width: 16%; }
.rehab-table:not(.rehab-table--overview) thead th:last-child { width: 42%; }

/* Рядки таблиці */
.rehab-table tbody tr {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.rehab-table tbody tr:hover {
    background: #e9f5e3;
    box-shadow: 0 4px 15px rgba(145, 208, 114, 0.2);
}

.rehab-table td {
    padding: 20px;
    border: none;
    vertical-align: middle;
}

.rehab-table tbody tr td:first-child { border-radius: 12px 0 0 12px; }
.rehab-table tbody tr td:last-child { border-radius: 0 12px 12px 0; }
.rehab-table thead th:first-child:last-child { border-radius: 12px 12px 0 0; }
.rehab-table tbody tr td:first-child:last-child { border-radius: 12px; }

.rehab-link-section {
    padding: 60px 0 80px;
}

.rehab-overview-card {
    margin: 0 auto 56px;
    padding: 28px 32px;
    background: #f8fcf6;
    border-left: 4px solid #91d072;
    border: 1px solid rgba(145, 208, 114, 0.25);
    border-radius: 12px;
    max-width: 900px;
}

.rehab-overview-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.rehab-overview-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.rehab-overview-header h2 {
    margin: 0 0 10px;
    font-size: 1.55rem;
    color: #1a1a1a;
    font-weight: 700;
}

.rehab-overview-header p {
    margin: 0;
    color: #2c3e50;
    line-height: 1.65;
    font-size: 1rem;
}

.rehab-overview-list {
    margin: 0;
    padding-left: 0;
    display: grid;
    gap: 12px;
    list-style: none;
}

.rehab-overview-list li {
    padding-left: 28px;
    position: relative;
    color: #2c3e50;
    line-height: 1.65;
    font-size: 0.95rem;
}

.rehab-overview-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    color: #91d072;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
}

.rehab-groups {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.rehab-group {
    max-width: 1160px;
    margin: 0 auto;
}

.rehab-group-header {
    margin-bottom: 32px;
    text-align: center;
}

.rehab-group-title {
    margin: 0 0 14px;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.rehab-group-lead {
    margin: 0 auto;
    max-width: 740px;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #2c3e50;
    font-family: 'Montserrat', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

.rehab-table--overview thead th {
    width: auto;
}

.rehab-table--overview {
    border-spacing: 0 18px;
    width: 100%;
    table-layout: fixed;
}

.rehab-table--overview thead th:first-child {
    width: calc(100% - 160px);
}

.rehab-table--overview thead th:last-child {
    width: 160px;
    text-align: center;
}

.rehab-table--overview tbody td {
    padding: 20px;
}

.rehab-table--overview tbody td:last-child {
    text-align: center;
}

.method-cell--simple {
    align-items: flex-start;
    gap: 18px;
}

.method-cell--simple .method-details {
    gap: 8px;
    min-width: 0;
    max-width: 600px;
}

.method-cell--simple .method-description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.625;
    color: #2c3e50;
}

.method-cell--simple .method-title {
    font-family: 'Montserrat', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.625;
}

.action-cell {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.method-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid #91d072;
    background: #f4f9f1;
    color: #1c2a33;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
}

.method-action svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.method-action:hover,
.method-action:focus {
    background: #91d072;
    border-color: #91d072;
    color: #ffffff;
}

.method-action:hover svg,
.method-action:focus svg {
    transform: translateX(4px);
}

/* ===========================
   КОМІРКА МЕТОДУ
   =========================== */

.method-cell {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.method-icon {
    width: 42px;
    height: 42px;
    background: #91d072;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.rehab-table tbody tr:hover .method-icon {
    transform: scale(1.1);
}

.method-icon svg { color: white; }

.method-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    font-family: 'Montserrat', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

.method-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: color 0.3s ease;
}

.method-link::after {
    content: '→';
    font-size: 0.9rem;
    color: var(--accent-color, #91d072);
    transition: transform 0.3s ease;
}

.method-link:hover,
.method-link:focus {
    color: var(--accent-color, #91d072);
}

.method-link:hover::after,
.method-link:focus::after {
    transform: translateX(4px);
}

/* ===========================
   КОМІРКА КАТЕГОРІЇ
   =========================== */

.category-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg { color: #5fa83b; }

.category-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* ===========================
   КОМІРКА ТРИВАЛОСТІ
   =========================== */

.duration-cell {
    display: flex;
    flex-direction: column;
}

.duration-main {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.duration-sub {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* ===========================
   ПОКАЗАННЯ - ДЕСКТОП
   =========================== */

.indications-desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.indication-minimal {
    position: relative;
    padding-left: 15px;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

.indication-minimal::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #91d072;
    border-radius: 50%;
}

.indication-minimal::after {
    content: '|';
    margin-left: 10px;
    color: #ddd;
}

.indication-minimal:last-child::after { display: none; }

/* ===========================
   МОБІЛЬНИЙ АКОРДЕОН
   =========================== */

.mobile-accordion { 
    display: none; 
}

.mobile-card {
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    cursor: pointer;
    gap: 12px;
}

.mobile-card-header:active { 
    background: #e9f5e3; 
}

.mobile-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.mobile-icon {
    width: 40px;
    height: 40px;
    background: #91d072;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-icon svg { color: white; }

.mobile-method-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.3;
}

.mobile-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.mobile-arrow svg { color: #91d072; }

.mobile-card.active .mobile-arrow { 
    transform: rotate(180deg); 
}

/* ===========================
   КОНТЕНТ МОБІЛЬНОЇ КАРТКИ
   =========================== */

.mobile-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.mobile-card.active .mobile-card-content { 
    max-height: 800px; 
}

.mobile-card-inner {
    padding: 0 18px 18px;
}

.mobile-card-desc {
    margin: 0 0 16px;
    line-height: 1.6;
    color: #2c3e50;
    font-size: 0.95rem;
}

.mobile-card-link-row {
    margin-top: 10px;
}

.mobile-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid #91d072;
    background: #f4f9f1;
    color: #1c2a33;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.mobile-card-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.mobile-card-link:hover,
.mobile-card-link:focus {
    background: #91d072;
    border-color: #91d072;
    color: #ffffff;
}

.mobile-card-link:hover::after,
.mobile-card-link:focus::after {
    transform: translateX(4px);
}

.mobile-info-row {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-info-row:last-child { 
    border-bottom: none; 
}

.mobile-info-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-info-value {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
}

.mobile-duration-sub {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    margin-top: 4px;
}

/* ===========================
   ПОКАЗАННЯ - МОБІЛЬНІ
   =========================== */

.mobile-indications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.mobile-indication-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
}

.mobile-indication-dot {
    width: 8px;
    height: 8px;
    background: #91d072;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-indication-text {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

/* ===========================
   АДАПТИВНІСТЬ
   =========================== */

@media (max-width: 768px) {
    .rehab-table-wrapper {
        display: none;
    }

    .mobile-accordion {
        display: block;
    }

    .rehab-overview-card {
        padding: 24px;
    }

    .rehab-overview-header {
        flex-direction: column;
        gap: 12px;
    }

    .rehab-overview-icon {
        font-size: 1.5rem;
    }

    .rehab-overview-header h2 {
        font-size: 1.4rem;
    }

    .rehab-overview-list li {
        font-size: 0.92rem;
    }

    .rehab-group-title {
        font-size: 1.8rem;
    }

    .rehab-group-lead {
        font-size: 1rem;
        max-width: 640px;
    }

    .rehab-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .rehab-overview-card {
        padding: 20px;
    }

    .rehab-overview-header h2 {
        font-size: 1.25rem;
    }

    .rehab-overview-list li {
        padding-left: 22px;
    }

    .important-note {
        padding: 15px 20px;
        font-size: 0.9rem;
    }

    .mobile-card-inner {
        padding: 0 16px 16px;
    }

    .rehab-card {
        padding: 24px 20px;
    }

    .rehab-card-title {
        font-size: 1.1rem;
    }
}
