/**
 * Category Toggle Component Styles
 * Shared between Set Menu and Pantry Item categories
 *
 * BB Square Integration Plugin
 * Version: 1.0.0
 */

.bb-category-toggle-container {
    width: 100%;
    margin: -5px 0 28px 0;
    padding: 0;
    clear: both;
    display: block;
}

.bb-category-toggle-tabs {
    display: flex;
    width: 100%;
    gap: 0px;
    margin: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #d0c4d8;
}

.bb-tab-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    border: none;
    padding: 12px 20px 18px 20px;
    height: 80px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bb-tab-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.bb-tab-button:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.bb-tab-button.active::before {
    background: rgba(0, 0, 0, 0.1);
}

.bb-tab-button.active {
    border: 3px solid #CB6CE6 !important;
    box-shadow: 0 0 15px rgba(203, 108, 230, 0.4);
}

.bb-tab-label {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 600;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    font-size: 20px;
    line-height: 1.2;
    margin-top: 5px;
}

.bb-tab-set-menu {
    background-color: #8B5A96;
    background-image: url('/wp-content/themes/astra-child/images/set-menu.png');
}

.bb-tab-pantry {
    background-color: #4A90A4;
    background-image: url('/wp-content/themes/astra-child/images/pantry-item.png');
}

.bb-tab-button:not(:last-child) {
    border-right: 2px solid #d0c4d8;
}

.bb-tab-button:hover .bb-tab-label,
.bb-tab-button.active .bb-tab-label {
    color: #CB6CE6;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .bb-tab-button {
        padding: 10px 15px 15px 15px;
        height: 70px;
    }

    .bb-tab-label {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bb-tab-button {
        padding: 8px 10px 10px 10px;
        height: 50px;
    }

    .bb-tab-label {
        font-size: 14px;
    }
}

/* ============================================
   CATEGORY TOGGLE TRANSITION EFFECTS
   ============================================ */

/* Fade out animation when clicking toggle */
.bb-toggle-fade-out {
    animation: toggleFadeOut 0.2s ease-out forwards;
}

@keyframes toggleFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Fade in animation when arriving at new category */
.bb-toggle-fade-in {
    animation: toggleFadeIn 0.4s ease-in forwards;
}

@keyframes toggleFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .bb-toggle-fade-out,
    .bb-toggle-fade-in {
        animation: none !important;
        transition: none !important;
    }
}