/*
 * Mobile Bottom Navigation & Filter System Styles - RiPro Style
 */

/* ===== Mobile Bottom Navigation ===== */
.io-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eee;
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    max-width: 100%;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 12px;
}

.mobile-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav-item span {
    font-size: 11px;
    line-height: 1.2;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--theme-color);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

.nav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(20px);
    background: #ff4d4f;
    color: #fff;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: translateX(20px) scale(1);
    }
    50% {
        transform: translateX(20px) scale(1.1);
    }
}

/* Safe area for iPhone X+ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .io-mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-nav-container {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* ===== Filter Sidebar ===== */
.io-filter-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.filter-section {
    width: 100%;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.filter-title i {
    color: var(--theme-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #555;
}

/* Price Range Inputs */
.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.price-range-inputs input[type="number"] {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.price-range-inputs input[type="number"]:focus {
    border-color: var(--theme-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--theme-color-rgb), 0.1);
}

.price-separator {
    color: #999;
    font-weight: 600;
}

.price-slider {
    height: 6px;
    background: linear-gradient(to right, #e0e0e0 0%, #e0e0e0 100%);
    border-radius: 3px;
    position: relative;
    margin-top: 15px;
}

.price-slider::before,
.price-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--theme-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.price-slider::before {
    left: 0;
}

.price-slider::after {
    right: 0;
}

.price-slider::before:hover,
.price-slider::after:hover {
    transform: translateY(-50%) scale(1.2);
}

/* Filter Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    background: #f5f5f5;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--theme-color);
}

.filter-checkbox span {
    font-size: 14px;
    color: #555;
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.filter-select:focus {
    border-color: var(--theme-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--theme-color-rgb), 0.1);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.filter-actions .btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--hover-color) 100%);
    border: none;
    color: #fff;
}

.filter-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--theme-color-rgb), 0.4);
}

.filter-actions .btn-secondary {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    color: #666;
}

.filter-actions .btn-secondary:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

/* ===== Filter Bar ===== */
.io-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.filter-bar-left {
    display: flex;
    align-items: center;
}

.results-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Quick Sort */
.quick-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sort-link {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sort-link:hover {
    background: #f5f5f5;
    color: var(--theme-color);
}

.sort-link.active {
    background: var(--theme-color-bg);
    color: var(--theme-color);
    font-weight: 600;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 5px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 16px;
}

.view-btn:hover {
    background: #e8e8e8;
}

.view-btn.active {
    background: #fff;
    color: var(--theme-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .io-mobile-bottom-nav {
        display: block;
    }
    
    /* Add bottom padding to body to prevent content from being hidden behind nav */
    body {
        padding-bottom: 70px;
    }
    
    .io-filter-sidebar {
        display: none; /* Hide sidebar on mobile, use modal instead */
    }
    
    .io-filter-bar {
        flex-direction: column;
        gap: 15px;
        padding: 12px 15px;
    }
    
    .filter-bar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .quick-sort {
        flex-wrap: wrap;
    }
    
    .sort-link {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .mobile-nav-item i {
        font-size: 20px;
    }
    
    .mobile-nav-item span {
        font-size: 10px;
    }
    
    .nav-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .results-count {
        font-size: 12px;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .io-mobile-bottom-nav {
        background: #1a1a1a;
        border-top-color: #333;
    }
    
    .mobile-nav-item {
        color: #999;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        color: var(--theme-color);
    }
    
    .nav-badge {
        border-color: #1a1a1a;
    }
    
    .io-filter-sidebar,
    .io-filter-bar {
        background: #1a1a1a;
    }
    
    .filter-title,
    .filter-label {
        color: #e0e0e0;
    }
    
    .price-range-inputs input[type="number"],
    .filter-select {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .filter-checkbox:hover {
        background: #2a2a2a;
    }
    
    .filter-checkbox span {
        color: #e0e0e0;
    }
    
    .view-switcher {
        background: #2a2a2a;
    }
    
    .view-btn.active {
        background: #333;
    }
    
    .sort-link:hover {
        background: #2a2a2a;
    }
}
