﻿/* ===== Header Tabs Wrapper ===== */
.header-tabs-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    padding: 0.5rem 1rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd transparent;
}

    .header-tabs-wrapper::-webkit-scrollbar {
        height: 4px;
    }

    .header-tabs-wrapper::-webkit-scrollbar-thumb {
        background-color: #adb5bd;
        border-radius: 2px;
    }

/* ===== Tab List ===== */
.header-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1140px;
}

/* ===== Tab Item ===== */
.header-tab-item {
    flex-shrink: 0;
}

/* ===== Tab Link ===== */
.header-tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

    .header-tab-link::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 60%;
        height: 3px;
        border-radius: 3px 3px 0 0;
        background-color: #4169e1;
        transition: transform 0.25s ease;
    }

    /* Hover state */
    .header-tab-link:hover {
        color: #4169e1;
        background-color: rgba(65, 105, 225, 0.06);
        text-decoration: none;
    }

        .header-tab-link:hover::after {
            transform: translateX(-50%) scaleX(1);
        }

    /* Active state */
    .header-tab-link.active {
        color: #fff;
        background: linear-gradient(135deg, #4169e1 0%, #365acb 100%);
        box-shadow: 0 -2px 8px rgba(65, 105, 225, 0.25);
    }

        .header-tab-link.active::after {
            display: none;
        }

        .header-tab-link.active .header-tab-icon {
            color: #fff;
        }

/* ===== Tab Icon ===== */
.header-tab-icon {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.header-tab-link:hover .header-tab-icon {
    transform: translateY(-1px);
}

/* ===== Tab Label ===== */
.header-tab-label {
    line-height: 1.2;
}

/* ===== Responsive ===== */

/* Tablet: slightly smaller, allow wrapping to two rows */
@media (max-width: 992px) {
    .header-tab-link {
        padding: 0.5rem 0.7rem 0.4rem;
        font-size: 0.75rem;
    }

    .header-tab-icon {
        font-size: 1rem;
    }
}

/* Small tablet: inline icon + label to save vertical space */
@media (max-width: 768px) {
    .header-tabs-wrapper {
        padding: 0.4rem 0.5rem 0;
    }

    .header-tabs {
        gap: 0.2rem;
    }

    .header-tab-link {
        flex-direction: row;
        gap: 0.35rem;
        padding: 0.45rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 0.35rem 0.35rem 0 0;
    }

    .header-tab-icon {
        font-size: 0.85rem;
    }
}

/* Mobile: icons only with tooltip on hover/tap */
@media (max-width: 576px) {
    .header-tab-label {
        display: none;
    }

    .header-tab-link {
        padding: 0.55rem 0.7rem;
        flex-direction: column;
    }

    .header-tab-icon {
        font-size: 1.15rem;
    }

    /* Tooltip on hover/focus for icon-only tabs */
    .header-tab-link:hover::before,
    .header-tab-link:focus::before {
        content: attr(aria-label);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        padding: 0.3rem 0.6rem;
        background-color: #2C3E50;
        color: #fff;
        font-size: 0.7rem;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 10;
        pointer-events: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }
}
