/* public/css/components/tabs.css (ФІНАЛЬНА ВЕРСІЯ) */
.tabs-container {
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.tabs-nav {
    position: relative;
    display: flex;
    align-items: center;
}

.tab-link:not(.hidden) {
    flex-grow: 1;
    flex-basis: 0;
    z-index: 10;
    display: flex; 
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    /* ✅ ЗМІНЕНО: Зменшено відступи для мобільних */
    padding: 0.75rem 0.25rem;
    font-weight: 600;
    color: #4B5563; /* text-gray-600 */
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    gap: 0.5rem;
}

.tab-content-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* --- ✅ ПОЧАТОК ВЕЛИКИХ ЗМІН (Вирішення Проблем 1, 2, 3) --- */

/* 1. Сховаємо текст за замовчуванням (на мобільних) */
.tab-link .tab-text {
    display: none;
}
/* 2. Показуємо текст, ТІЛЬКИ ЯКЩО вкладка активна */
.tab-link.active .tab-text {
    display: inline;
}

/* 2b. Відступ між текстом/лічильником — через margin на самих елементах (надійніше за gap) */
.tab-content-wrapper .tab-text {
    margin-left: 0.375rem; /* Відступ зліва від іконки */
}
.tab-content-wrapper .tab-count {
    margin-left: 0.375rem; /* Відступ зліва від тексту або іконки */
}

/* 3. На ПК (md) - показуємо текст ЗАВЖДИ */
@media (min-width: 768px) {
    .tab-link .tab-text {
        display: inline;
    }
}

/* --- Вкладки "Розклад" на мобільному: показуємо скорочені назви днів для всіх вкладок --- */
@media (max-width: 767px) {
    .schedule-tab-link .tab-text--full {
        display: none !important;
    }
    .schedule-tab-link .tab-text--short {
        display: inline !important;
    }
    /* Невктивні вкладки — видимий сірий колір тексту */
    .schedule-tab-link:not(.active) {
        color: #4B5563;
    }
}
@media (min-width: 768px) {
    .schedule-tab-link .tab-text--short {
        display: none !important;
    }
    .schedule-tab-link .tab-text--full {
        display: inline !important;
    }
}

/* --- ❌ ВИДАЛЕНО ВСІ СТАРІ ПРАВИЛА для .tab-text та .tab-link span --- */
/* (Видалено: .tab-link .tab-text { transition... max-width: 0... }) */
/* (Видалено: .tab-link.active .tab-text { max-width: 100px... }) */
/* (Видалено: @media (min-width: 768px) .tab-link .tab-text { ... }) */
/* (Видалено: .tab-link span { ... }) */
/* (Видалено: .tab-link.active .tab-content-wrapper span { ... }) */
/* (Видалено: @media (min-width: 768px) .tab-link span { ... }) */


/* Решта стилів залишається */

/* ✅ ПОЧАТОК ЗМІН (Проблема 3: Розмір шрифту) */
.main-tab-link {
    font-size: 0.875rem; /* 14px (було 1rem) */
}
.nested-tab-link {
    font-size: 0.75rem; /* 12px (було 0.875rem) */
}

/* Повертаємо більший шрифт для ПК */
@media (min-width: 768px) {
    .main-tab-link {
        font-size: 1rem;
    }
    .nested-tab-link {
        font-size: 0.875rem;
    }
}
/* ✅ КІНЕЦЬ ЗМІН (Проблема 3) */

.tab-link:hover {
    color: #111827;
}

.tab-link.active {
    color: #2563EB;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tab-link i {
    font-size: 1.25rem;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    background-color: #2563EB;
    border-radius: 9999px;
    
    /* ✅ ВИПРАВЛЕНО (Проблема 1): 
       Анімуємо 'left' і 'width' окремо, 
       щоб не конфліктувати з JS, який вимірює ширину. */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-indicator::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 16px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
}

.tab-count {
    background-color: #3B82F6;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}

.tab-count--danger {
    background-color: var(--color-danger) !important;
    color: white !important;
}

.tab-link:not(.active) .tab-count {
    background-color: #D1D5DB;
    color: #374151;
}

.tab-link:not(.active) .tab-count--danger {
    background-color: var(--color-danger) !important;
    color: white !important;
}