/* ============================================
   SHARED TAB NAVIGATION STYLES
   Reusable tab components across the app
   ============================================ */

/* ===== Tab Container ===== */
.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Tab Navigation ===== */
.tabs-navigation,
.tab-navigation {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    border-radius: 12px;
    overflow-x: auto;
    flex-wrap: wrap;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Hide scrollbar but allow scroll */
.tabs-navigation::-webkit-scrollbar,
.tab-navigation::-webkit-scrollbar {
    height: 0;
    display: none;
}

/* ===== Tab Buttons ===== */
.tab-btn,
.tab-button {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Category tabs (shared with tab buttons) */
.category-tab {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover,
.tab-button:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #ffffff);
}

.category-tab:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #ffffff);
}

.tab-btn.active,
.tab-button.active {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-btn.active:hover,
.tab-button.active:hover {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: white;
}

.category-tab.active {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-tab.active:hover {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: white;
}

/* Light theme: ensure active tab text is white */
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .tab-button.active {
    color: white;
}

/* Tab icon */
.tab-btn .tab-icon,
.tab-button .tab-icon {
    font-size: 16px;
}

/* Tab count badge */
.tab-btn .tab-count,
.tab-button .tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.tab-btn.active .tab-count,
.tab-button.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== Tab Content ===== */
.tab-content,
.tabs-content {
    background: var(--bg-card, #1e1e2a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 24px;
    min-height: 200px;
}

/* ===== Variant: Pill Tabs ===== */
.tabs-navigation.pills,
.tab-navigation.pills {
    background: transparent;
    padding: 0;
    gap: 12px;
}

.tabs-navigation.pills .tab-btn,
.tab-navigation.pills .tab-button {
    padding: 8px 16px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--bg-card, rgba(255, 255, 255, 0.05));
}

.tabs-navigation.pills .tab-btn.active,
.tab-navigation.pills .tab-button.active {
    border-color: var(--accent-primary, #6366f1);
}

/* ===== Variant: Underline Tabs ===== */
.tabs-navigation.underline,
.tab-navigation.underline {
    background: transparent;
    padding: 0;
    border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0;
    gap: 0;
}

.tabs-navigation.underline .tab-btn,
.tab-navigation.underline .tab-button {
    border-radius: 0;
    padding: 12px 20px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.tabs-navigation.underline .tab-btn.active,
.tab-navigation.underline .tab-button.active {
    background: transparent;
    box-shadow: none;
    border-bottom-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
}

/* ===== Variant: Compact Tabs ===== */
.tabs-navigation.compact,
.tab-navigation.compact {
    padding: 4px;
    gap: 4px;
}

.tabs-navigation.compact .tab-btn,
.tab-navigation.compact .tab-button {
    padding: 8px 14px;
    font-size: 13px;
}

/* ===== Light Mode Overrides ===== */
[data-theme="light"] .tabs-navigation,
[data-theme="light"] .tab-navigation {
    background: var(--bg-secondary, #f1f5f9);
}

[data-theme="light"] .tab-btn,
[data-theme="light"] .tab-button {
    color: var(--text-secondary, #475569);
}

[data-theme="light"] .tab-btn:hover,
[data-theme="light"] .tab-button:hover {
    background: var(--bg-hover, #e2e8f0);
    color: var(--text-primary, #1e293b);
}

[data-theme="light"] .tab-content,
[data-theme="light"] .tabs-content {
    background: var(--bg-card, #ffffff);
    border-color: var(--border-color, #e2e8f0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .tabs-navigation,
    .tab-navigation {
        padding: 6px;
        gap: 6px;
    }

    .tab-btn,
    .tab-button {
        padding: 8px 14px;
        font-size: 13px;
    }

    .tab-content,
    .tabs-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .tabs-navigation,
    .tab-navigation {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn,
    .tab-button {
        flex-shrink: 0;
    }
}
