/* Amazon-style Sidebar - Advanced Styling */

/* Base Sidebar */
.amazon-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 1050;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    border-left: 3px solid #ff9900;
}

.amazon-sidebar.active {
    right: 0;
}

/* Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 
        0 8px 25px rgba(35, 47, 62, 0.3),
        0 3px 10px rgba(35, 47, 62, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1051;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #37475a 0%, #232f3e 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 35px rgba(35, 47, 62, 0.4),
        0 5px 15px rgba(35, 47, 62, 0.3);
}

.sidebar-toggle:active {
    transform: translateY(-1px) scale(1.01);
}

.sidebar-toggle i {
    font-size: 16px;
    animation: pulse 2s infinite;
}

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

/* Sidebar Content */
.sidebar-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 30px;
    scroll-behavior: smooth;
}

/* Header */
.sidebar-header {
    background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
    color: white;
    padding: 25px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sidebar-header h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.btn-close-sidebar {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-sidebar:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* Quick Links */
.quick-links {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 2px solid #dee2e6;
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 14px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.quick-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: right 0.6s ease;
}

.quick-link:hover::before {
    right: 100%;
}

.quick-link:hover, .quick-link.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.quick-link i {
    width: 20px;
    text-align: center;
    margin-left: 10px;
    font-size: 16px;
}

/* Sections */
.sidebar-section {
    border-bottom: 1px solid #e9ecef;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.sidebar-section:hover {
    background: rgba(248, 249, 250, 0.5);
}

.section-title {
    color: #232f3e;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #ff9900;
    position: relative;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 30%;
    height: 3px;
    background: linear-gradient(90deg, #ff9900, #ffab40);
    border-radius: 2px;
}

.section-title i {
    color: #ff9900;
    margin-left: 8px;
    font-size: 18px;
}

/* Categories */
.categories-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.category-item {
    margin-bottom: 2px;
    position: relative;
}

.category-main {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    background: white;
    border: 1px solid transparent;
}

.category-main:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #007bff;
    transform: translateX(-3px);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.category-main.active {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    color: #0056b3;
    font-weight: 700;
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin-left: 12px;
    object-fit: cover;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.category-main:hover .category-icon {
    border-color: #007bff;
    transform: scale(1.1);
}

.category-icon-text {
    width: 28px;
    text-align: center;
    margin-left: 12px;
    color: #6c757d;
    font-size: 16px;
    transition: all 0.3s ease;
}

.category-main:hover .category-icon-text {
    color: #007bff;
    transform: scale(1.1);
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.category-arrow {
    font-size: 12px;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.7;
}

.category-item:hover .category-arrow {
    transform: translateX(-5px);
    color: #007bff;
    opacity: 1;
}

/* Subcategories Dropdown */
.subcategories {
    position: absolute;
    right: 100%;
    top: 0;
    width: 320px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: -8px 0 25px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 450px;
    overflow-y: auto;
}

.category-item:hover .subcategories {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    right: 100%;
}

.subcategory-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 2px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

.view-all-sub {
    color: #007bff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.view-all-sub:hover {
    color: #0056b3;
    transform: translateX(-3px);
}

.view-all-sub::before {
    content: '→';
    margin-left: 8px;
    transition: all 0.3s ease;
}

.view-all-sub:hover::before {
    transform: translateX(-3px);
}

.subcategory-item {
    display: block;
    padding: 10px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
    position: relative;
}

.subcategory-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    transition: width 0.3s ease;
}

.subcategory-item:hover, .subcategory-item.active {
    background: rgba(0, 123, 255, 0.05);
    color: #007bff;
    padding-right: 25px;
}

.subcategory-item:hover::before, .subcategory-item.active::before {
    width: 4px;
}

/* Filter Components */
.filter-content {
    font-size: 14px;
}

.custom-price {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.custom-price:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.custom-price .form-control {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.custom-price .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-price .btn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.custom-price .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Filter Lists */
.price-ranges, .brands-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}

.price-range-item, .brand-item, .rating-item, .availability-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e9ecef;
}

.price-range-item:hover, .brand-item:hover, .rating-item:hover, .availability-item:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: #007bff;
    transform: translateX(-3px);
}

.price-range-item input, .brand-item input, .rating-item input, .availability-item input {
    margin-left: 10px;
    cursor: pointer;
    transform: scale(1.2);
    accent-color: #007bff;
}

/* Stars Rating */
.stars {
    margin: 0 10px;
    display: flex;
    gap: 2px;
}

.stars .fa-star {
    color: #ddd;
    font-size: 14px;
    transition: all 0.3s ease;
}

.stars .fa-star.active {
    color: #ff9900;
    text-shadow: 0 0 5px rgba(255, 153, 0, 0.5);
}

.rating-text {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Brand Search */
.search-brands {
    margin-bottom: 15px;
}

.search-brands .form-control {
    font-size: 13px;
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    background: white;
    transition: all 0.3s ease;
}

.search-brands .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: #f8f9fa;
}

/* Recent Searches */
.recent-searches {
    font-size: 13px;
}

.recent-search-item {
    display: block;
    padding: 8px 15px;
    color: #6c757d;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    font-weight: 500;
}

.recent-search-item:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
    border-color: #007bff;
    transform: translateX(-3px);
}

/* Clear Filters Button */
.sidebar-section .btn-outline-secondary {
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    border: 2px solid #6c757d;
}

.sidebar-section .btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .amazon-sidebar {
        width: 380px;
        right: -380px;
    }
    
    .subcategories {
        width: 300px;
    }
}

@media (max-width: 992px) {
    .amazon-sidebar {
        width: 360px;
        right: -360px;
    }
    
    .subcategories {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .amazon-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .sidebar-toggle {
        right: 15px;
        padding: 12px 18px;
        font-size: 13px;
    }
    
    .subcategories {
        width: 90%;
        right: 95%;
    }
}

@media (max-width: 576px) {
    .sidebar-toggle {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .sidebar-header {
        padding: 20px;
    }
    
    .sidebar-section {
        padding: 20px;
    }
}

/* Custom Scrollbar */
.sidebar-content::-webkit-scrollbar,
.categories-list::-webkit-scrollbar,
.subcategories::-webkit-scrollbar,
.price-ranges::-webkit-scrollbar,
.brands-list::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track,
.categories-list::-webkit-scrollbar-track,
.subcategories::-webkit-scrollbar-track,
.price-ranges::-webkit-scrollbar-track,
.brands-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb,
.categories-list::-webkit-scrollbar-thumb,
.subcategories::-webkit-scrollbar-thumb,
.price-ranges::-webkit-scrollbar-thumb,
.brands-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c1c1c1, #a1a1a1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.categories-list::-webkit-scrollbar-thumb:hover,
.subcategories::-webkit-scrollbar-thumb:hover,
.price-ranges::-webkit-scrollbar-thumb:hover,
.brands-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a1a1a1, #888);
}

/* Animation Classes */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.amazon-sidebar.active {
    animation: slideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.amazon-sidebar.closing {
    animation: slideOutRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Loading State */
.filter-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .amazon-sidebar {
        background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
        border-left-color: #ff9900;
    }
    
    .sidebar-header {
        background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    }
    
    .quick-links {
        background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    }
    
    .sidebar-section {
        border-bottom-color: #3a3a3a;
    }
    
    .category-main, .subcategory-item, .price-range-item, .brand-item, .rating-item, .availability-item, .recent-search-item {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }
    
    .section-title {
        color: #e0e0e0;
    }
}
