@charset "UTF-8";

/* ===========================
   Set Detail Styles
   =========================== */

/* ===== Color & Layout Variables ===== */
:root {
    --border-color: #ccc;
    --border-radius: 8px;
    --autocomplete-max-height: 200px;
    --autocomplete-width: 284px;
    --suggestion-padding: 8px;
    --overlay-color: rgba(128, 128, 128, 0.5);
    --overlay-radius: 0.5rem;
}

/* ===== Filter Menu Container ===== */
.filter-menu-container {
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: #f9f9f9;
}

.filter-menu-group {
    margin-bottom: 1.5rem;
}

.filter-menu-group:last-child {
    margin-bottom: 0;
}

.filter-menu-group p {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-menu-group ul {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.filter-menu-group li {
    list-style: none;
    margin-bottom: 0.5rem;
}

.filter-menu-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.filter-menu-group label {
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* ===== Autocomplete Suggestions ===== */
.autocomplete-suggestions {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--border-color);
    max-height: var(--autocomplete-max-height);
    overflow-y: auto;
    width: var(--autocomplete-width);
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestion {
    padding: var(--suggestion-padding);
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-suggestion:hover {
    background-color: #f0f0f0;
}

.autocomplete-suggestion:active {
    background-color: #e0e0e0;
}

/* ===== Collection Entry Buttons ===== */
.btn-collection-entry {
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.collection-entry {
    padding: 0.25rem;
    width: 50px;
    text-align: center;
}

/* ===== Card Display State ===== */
.not-owned {
    filter: grayscale(10%) brightness(0.7);
    opacity: 0.8;
}

/* ===== Card Selection Overlay ===== */
.card-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 128, 128, 0.4);
    z-index: 5;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.single-card.selected .card-select-overlay {
    background: rgba(0, 0, 0, 0);
}

.single-card.selected {
    filter: none;
}

.single-card.selected .card {
    border: 3px solid #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.single-card.select-mode:not(.selected) {
    filter: grayscale(1) brightness(0.8);
}

.single-card.select-mode:not(.selected):hover {
    filter: grayscale(0.8) brightness(0.9);
}

/* ===== Card Selection Toolbar ===== */
.card-selection-toolbar {
    transition: all 0.3s ease;
}

.card-selection-toolbar #bulkActionButtons {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .autocomplete-suggestions {
        width: 100%;
        max-width: 90vw;
    }

    .filter-menu-container {
        margin-bottom: 1.5rem;
    }

    .collection-entry {
        width: 45px;
        padding: 0.2rem;
    }
}

/* ===== Accessibility ===== */
.filter-menu-group input:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.autocomplete-suggestion:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.loading-overlay.d-none {
    display: none;
}

.loading-spinner {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.loading-spinner .spinner-border {
    width: 50px;
    height: 50px;
    border-width: 4px;
}

.loading-spinner p {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* ===== MOBILE FILTER PANEL ===== */
.mobile-filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    animation: slideInFilter 0.3s ease-out;
}

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

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.mobile-filter-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-filter-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-filter-close-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.mobile-filter-close-btn:active {
    transform: scale(0.95);
}

.mobile-filter-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-filter-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.mobile-filter-actions .btn {
    flex: 1;
    padding: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Sync mobile filter inputs with desktop filter inputs */
@media (max-width: 768px) {
    #mobileFilterToggle {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* ===== Lazy Loading Styles ===== */
img[loading="lazy"] {
    transition: opacity 0.4s ease-in-out;
}

img[loading="lazy"]:not(.lazy-loaded) {
    opacity: 0.6;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img.lazy-loaded {
    opacity: 1;
}

img.lazy-error {
    opacity: 1;
    border: 2px solid #ffebee;
    background-color: #f5f5f5;
}

/* Shimmer loading animation */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading state for card items */
.single-card img:not(.lazy-loaded) {
    min-height: 280px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth fade-in for loaded images */
.single-card img.lazy-loaded {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

