/* Collection tab styles */
.grid-container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-slot {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card-slot:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-slot.owned {
    border: 3px solid #4CAF50;
}

.card-slot.missing {
    border: 3px solid #f44336;
}

.card-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.main-image-container {
    position: relative;
    margin-bottom: 15px;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: filter 0.3s ease;
}

.main-image.greyscale {
    filter: grayscale(100%) opacity(0.6);
}

.main-image.owned {
    cursor: pointer;
}

.main-image.owned:hover {
    opacity: 0.8;
}

.variants-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.variant-image {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.variant-image:hover {
    border-color: #2196F3;
    transform: scale(1.1);
}

.variant-image.active {
    border-color: #FF9800;
    border-width: 3px;
}

.variant-image.greyscale {
    filter: grayscale(100%) opacity(0.6);
}

.card-info {
    text-align: center;
}

.card-name {
    color: #2196F3;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.card-name:hover {
    color: #1976D2;
}

.card-price {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1rem;
}

.price-timestamp {
    font-size: 0.75rem;
    font-weight: normal;
    font-style: italic;
    color: #666;
}

/* Collection header (hidden by default) - styles moved to edit-mode.css */
/* These are legacy styles kept for backwards compatibility */
.collection-header input[type="text"] {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 250px;
}

.collection-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #333;
}

.collection-header input[type="checkbox"] {
    transform: scale(1.2);
}

.collection-header button {
    padding: 10px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* Quantity controls container */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px;
}

/* Quantity buttons (minus and plus) */
.quantity-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.quantity-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quantity-button:active {
    transform: scale(0.95);
}

.quantity-button:disabled {
    background: #f0f0f0;
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state for quantity buttons */
.quantity-button.loading {
    background: #e0e0e0;
    border-color: #999;
    color: #999;
    cursor: wait;
    position: relative;
}

.quantity-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Success state for quantity buttons */
.quantity-button.success {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* Quantity display */
.quantity-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

/* Floating clear search button */
.floating-clear-search-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* Show button only when collection tab is active */
#collection-tab.active .floating-clear-search-btn {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.floating-clear-search-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.floating-clear-search-btn:active {
    transform: scale(0.95);
}

.floating-clear-search-btn svg {
    width: 28px;
    height: 28px;
}

/* Mobile responsiveness for collection */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .grid-container {
        padding: 15px;
        margin-top: 20px;
    }
    
    .collection-filters {
        flex-direction: column;
        gap: 15px;
    }

    .collection-header input[type="text"] {
        min-width: 200px;
        width: 100%;
    }
    
    .floating-clear-search-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-clear-search-btn svg {
        width: 24px;
        height: 24px;
    }
}