/**
 * GlamBug Mobile UI - Main Styles
 * Trendy, modern mobile UI with animations
 */

/* ===========================
   Bottom Menu Bar
   =========================== */

.glambug-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Show only on mobile */
@media (max-width: 768px) {
    .glambug-bottom-menu {
        display: block;
    }
    
    /* Add padding to body to prevent content being hidden */
    body {
        padding-bottom: 80px;
    }
}

.glambug-bottom-menu-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 8px;
    max-width: 100%;
    margin: 0 auto;
    gap: 4px;
}

.glambug-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 12px;
    position: relative;
    border-radius: 20px;
    background: transparent;
    min-height: 40px;
    gap: 8px;
}

.glambug-menu-item .menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.glambug-menu-item .menu-icon svg {
    width: 22px;
    height: 22px;
    transition: all 0.3s ease;
}

.glambug-menu-item .menu-label {
    font-size: 13px;
    font-weight: 600;
    transition: all 0.4s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
}

/* Active state - pill shape with text */
.glambug-menu-item.active {
    background: #e8eaf6;
    color: #5f6fd8;
    padding: 10px 16px;
}

.glambug-menu-item.active .menu-icon svg {
    color: #5f6fd8;
}

.glambug-menu-item.active .menu-label {
    opacity: 1;
    max-width: 100px;
    margin-left: 4px;
}

/* Loading state animation for page transitions */
.glambug-menu-item.loading {
    animation: menuItemLoading 0.6s ease-in-out;
}

@keyframes menuItemLoading {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/* Cart count badge */
.glambug-menu-item .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff4081, #ff6b9d);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 64, 129, 0.4);
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Bounce animation on tap */
.glambug-menu-item.animation-bounce:active .menu-icon {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(-7px);
    }
}

/* Scale animation */
.glambug-menu-item.animation-scale:active .menu-icon {
    animation: scale 0.3s;
}

@keyframes scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Slide up animation */
.glambug-menu-item.animation-slide-up:active {
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Pulse animation */
.glambug-menu-item.animation-pulse:active .menu-icon {
    animation: menuPulse 0.4s;
}

@keyframes menuPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark theme */
.glambug-bottom-menu.theme-dark {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.glambug-bottom-menu.theme-dark .glambug-menu-item {
    color: #aaa;
}

.glambug-bottom-menu.theme-dark .glambug-menu-item.active {
    background: #3d3d3d;
    color: #a5b4fc;
}

.glambug-bottom-menu.theme-dark .glambug-menu-item.active .menu-icon svg {
    color: #a5b4fc;
}

/* ===========================
   Category Slider
   =========================== */

.glambug-category-slider-wrapper {
    margin: 20px 0;
    position: relative;
    padding: 0;
    width: 100%;
}

.glambug-category-slider-container {
    position: relative;
    max-width: 100%;
}

.glambug-category-slider {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.glambug-category-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-slider-track {
    display: flex;
    gap: 5px;
    padding: 10px 0px;
}

.category-item {
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 100px;
}

.category-item .category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.category-item .category-link:hover {
    transform: translateY(-4px);
}

.category-image-wrapper {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.category-item:hover .category-image-wrapper {
    transform: scale(1.05);
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
}

/* Navigation buttons */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.slider-nav:hover {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.slider-nav svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.slider-nav-prev {
    left: 0;
}

.slider-nav-next {
    right: 0;
}

.slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile specific */
@media (max-width: 768px) {
    .glambug-category-slider-wrapper {
        margin: 15px 0;
        width: 100%;
        padding: 0;
    }
    
    .slider-nav {
        display: none;
    }
    
    .category-item {
        min-width: 70px;
        max-width: 85px;
    }
    
    .category-image-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .category-slider-track {
        gap: 5px;
        padding: 10px 0px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .category-item {
        min-width: 90px;
        max-width: 110px;
    }
    
    .category-image-wrapper {
        width: 80px;
        height: 80px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .glambug-category-slider-wrapper {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .category-slider-track {
        gap: 20px;
    }
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.category-item.loading .category-image-wrapper {
    opacity: 0.5;
}
