/* ============================================
   Premium Scrollable Tabs
   Courtechs Attache - Modern Tab Navigation
   Theme: Uses --org-primary from _Layout.cshtml
   Supports Court (Blue) and Law Firm (Green)
   ============================================ */

/* Tab Container Wrapper */
.premium-tabs-wrapper {
    position: relative;
    width: 100%;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Scroll Container */
.premium-tabs-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.premium-tabs-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Tab List */
.premium-tabs {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 4px 44px 0; /* Space for scroll buttons */
    min-width: max-content;
    border-bottom: none;
    gap: 2px;
}

.premium-tabs > li {
    flex-shrink: 0;
    margin: 0;
}

.premium-tabs > li > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: -1px;
    background: transparent;
}

.premium-tabs > li > a:hover {
    color: var(--org-primary);
    background: rgba(var(--org-primary-rgb), 0.08);
    text-decoration: none;
}

.premium-tabs > li.active > a,
.premium-tabs > li > a.active {
    color: #1e40af;
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* Active tab accent line on top - uses organization theme color */
.premium-tabs > li.active > a::before,
.premium-tabs > li > a.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--org-primary), var(--org-primary-hover));
    border-radius: 3px 3px 0 0;
}

/* Tab Icons */
.premium-tabs > li > a i,
.premium-tabs > li > a svg,
.premium-tabs > li > a .lucide,
.premium-tabs > li > a [data-lucide] {
    width: 15px;
    height: 15px;
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.premium-tabs > li > a:hover i,
.premium-tabs > li > a:hover svg {
    opacity: 0.8;
}

.premium-tabs > li.active > a i,
.premium-tabs > li.active > a svg,
.premium-tabs > li.active > a .lucide {
    opacity: 1;
    color: var(--org-primary);
}

/* Edge Fade Gradients - show more content exists */
.premium-tabs-wrapper::before,
.premium-tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.premium-tabs-wrapper::before {
    left: 32px;
    background: linear-gradient(90deg, rgba(248,250,252,1) 0%, rgba(248,250,252,0) 100%);
}

.premium-tabs-wrapper::after {
    right: 32px;
    background: linear-gradient(-90deg, rgba(248,250,252,1) 0%, rgba(248,250,252,0) 100%);
}

.premium-tabs-wrapper.can-scroll-left::before,
.premium-tabs-wrapper.can-scroll-right::after {
    opacity: 1;
}

/* Scroll Buttons */
.premium-tabs-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.premium-tabs-btn:hover {
    background: var(--org-primary);
    border-color: var(--org-primary);
    color: #ffffff;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(var(--org-primary-rgb), 0.3);
}

.premium-tabs-btn-left {
    left: 4px;
}

.premium-tabs-btn-right {
    right: 4px;
}

.premium-tabs-wrapper.can-scroll-left .premium-tabs-btn-left,
.premium-tabs-wrapper.can-scroll-right .premium-tabs-btn-right {
    opacity: 1;
    visibility: visible;
}

.premium-tabs-btn svg,
.premium-tabs-btn i {
    width: 14px;
    height: 14px;
}

/* Tab Badge/Count */
.premium-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    background: #ef4444;
    border-radius: 9px;
    margin-left: 4px;
    line-height: 1;
}

.premium-tab-badge.muted {
    background: #94a3b8;
}

.premium-tab-badge.info {
    background: var(--org-primary);
}

/* More Menu Dropdown */
.premium-tabs-more {
    position: relative;
    flex-shrink: 0;
}

.premium-tabs-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
    background: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.premium-tabs-more-btn:hover {
    color: var(--org-primary);
    background: rgba(var(--org-primary-rgb), 0.08);
}

.premium-tabs-more-btn.has-active {
    color: var(--org-primary);
    background: #ffffff;
    border-color: #e2e8f0;
}

.premium-tabs-more-btn i,
.premium-tabs-more-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.premium-tabs-more.open .premium-tabs-more-btn i,
.premium-tabs-more.open .premium-tabs-more-btn svg {
    transform: rotate(180deg);
}

.premium-tabs-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.premium-tabs-more.open .premium-tabs-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.premium-tabs-more-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.12s ease;
    border-left: 3px solid transparent;
}

.premium-tabs-more-menu a:first-child {
    border-radius: 7px 7px 0 0;
}

.premium-tabs-more-menu a:last-child {
    border-radius: 0 0 7px 7px;
}

.premium-tabs-more-menu a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.premium-tabs-more-menu a.active {
    background: rgba(var(--org-primary-rgb), 0.08);
    color: var(--org-primary);
    font-weight: 600;
    border-left-color: var(--org-primary);
}

.premium-tabs-more-menu a i,
.premium-tabs-more-menu a svg {
    width: 15px;
    height: 15px;
    opacity: 0.6;
}

.premium-tabs-more-menu a.active i,
.premium-tabs-more-menu a.active svg {
    opacity: 1;
}

/* Divider in more menu */
.premium-tabs-more-menu hr {
    margin: 6px 12px;
    border: none;
    border-top: 1px solid #e2e8f0;
}

/* Tab Content Animation */
@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.active {
    display: block;
    animation: tabFadeIn 0.25s ease;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .premium-tabs {
        padding: 4px 36px 0;
    }

    .premium-tabs > li > a {
        padding: 9px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .premium-tabs > li > a i,
    .premium-tabs > li > a svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 768px) {
    .premium-tabs {
        padding: 4px 32px 0;
        gap: 1px;
    }

    .premium-tabs > li > a {
        padding: 8px 10px;
        font-size: 11px;
    }

    .premium-tabs-btn {
        width: 24px;
        height: 24px;
    }

    .premium-tabs-btn svg,
    .premium-tabs-btn i {
        width: 12px;
        height: 12px;
    }
}

/* Keyboard Focus */
.premium-tabs > li > a:focus-visible {
    outline: 2px solid var(--org-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Compact Icon-Only Mode */
.premium-tabs.compact > li > a {
    padding: 10px 12px;
    gap: 0;
}

.premium-tabs.compact > li > a span:not(.premium-tab-badge) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.premium-tabs.compact > li > a i,
.premium-tabs.compact > li > a svg {
    width: 18px;
    height: 18px;
}

/* Tooltip for compact mode */
.premium-tabs.compact > li {
    position: relative;
}

.premium-tabs.compact > li > a[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    background: #1e293b;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 100;
    pointer-events: none;
}

.premium-tabs.compact > li > a[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 100;
}

.premium-tabs.compact > li > a[data-tooltip]:hover::after,
.premium-tabs.compact > li > a[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.premium-tabs.compact > li > a[data-tooltip]:hover::after {
    transform: translateX(-50%) scale(1);
}

/* Custom scrollbar for more menu */
.premium-tabs-more-menu::-webkit-scrollbar {
    width: 5px;
}

.premium-tabs-more-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.premium-tabs-more-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.premium-tabs-more-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   Visual Demo Reference:
   ============================================

   Normal state (all tabs fit):
   ┌─────────────────────────────────────────────────────────────────┐
   │ ▣ Case Info │ ◉ Parties │ ☰ Documents │ ▢ Hearings │ $ Finance │
   └─────────────────────────────────────────────────────────────────┘

   With scroll (arrows appear, edges fade):
   ┌─────────────────────────────────────────────────────────────────┐
   │ ◀ │░░ ▣ Case │ ◉ Parties │ ☰ Documents │ ▢ Hearing ░░│ ▶ │
   └─────────────────────────────────────────────────────────────────┘
         ↑ fade                                        fade ↑

   Compact mode (icons only + tooltips):
   ┌─────────────────────────────────────────────────────────┐
   │  ▣  │  ◉  │  ☰  │  ▢  │  $  │  ⚖  │  📋  │  ⋯  │
   └─────────────────────────────────────────────────────────┘
              ↑ [Tooltip: Parties]

   ============================================ */
