/* Sidebar Groups */
.sidebar-group {
    margin-bottom: 24px;
}

.sidebar-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.sidebar-group h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.search-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

/* Style Variants */
.style-variants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.style-variant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.style-variant::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition);
}

.style-variant:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.style-variant:hover::before {
    left: 100%;
}

.style-variant.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.style-variant .material-symbols-outlined,
.style-variant .material-symbols-rounded,
.style-variant .material-symbols-sharp {
    font-size: 20px;
}

/* Slider Labels */
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Category Controls */
.category-controls {
    margin-top: 20px;
}

.filter-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.category-item {
    padding: 14px 20px;
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition);
}

.category-item:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-item:hover::before {
    left: 100%;
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Variant Controls */
.variant-controls {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.variant-controls label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.variant-select {
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.variant-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 2px solid var(--border);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
}

.icon-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 8px rgba(221, 64, 103, 0.3);
}

.icon-item.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px rgba(221, 64, 103, 0.3);
}

.icon-item.multi-selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 8px rgba(221, 64, 103, 0.3);
    opacity: 0.8;
}


/* Selection info styles */
.selection-info {
    display: none; /* Hidden by default */
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.clear-btn:hover {
    background: #c82333;
}

.icon-item .material-symbols-outlined {
    font-size: 24px;
}
/* Ensure legacy Material Icons classes render at the same size in grid */
.icon-item .material-icons-outlined,
.icon-item .material-icons-round,
.icon-item .material-icons-sharp,
.icon-item .material-icons {
    font-size: 24px;
}

/* Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--border) 0%, var(--border-light) 100%);
    transition: var(--transition);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: var(--shadow);
}

input:checked + .slider-switch {
    background: var(--primary-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider-switch:before {
    transform: translateX(28px);
    box-shadow: var(--shadow-lg);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Bulk Download Modal Styles */
.bulk-info {
    text-align: center;
    margin: 20px 0;
}

.bulk-info p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.download-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color, #DD4067);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn-secondary, .btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: var(--primary-color, #DD4067);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color-dark, #c23456);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-btn:hover {
    color: var(--text-primary);
}

.export-size-options {
    margin-bottom: 20px;
}

.export-size-options h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.size-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.size-btn {
    padding: 10px 16px;
    border: 2px solid var(--border-light);
    background: var(--surface);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.size-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--transition);
}

.size-btn:hover {
    border-color: var(--primary-color);
    background: var(--surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.size-btn:hover::before {
    left: 100%;
}

.size-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.confirm-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.confirm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.confirm-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.confirm-btn:hover::before {
    left: 100%;
}

.confirm-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
        padding: 16px;
    }
    
    .category-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}