.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.search-modal {
    background: #1e1e1e;
    padding: 24px;
    border-radius: 14px;
    max-width: 600px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.search-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.search-close:hover {
    color: #fff;
}

.search-title {
    color: #ff6666;
    margin-bottom: 4px;
    font-size: 1.2rem;
}

.search-slot-label {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.search-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input-row input {
    flex: 1;
    background: #2a2a2a;
    border: 2px solid #444;
    color: #e0e0e0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.search-input-row input:focus {
    border-color: #ff4444;
}

.search-go-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-go-btn:hover {
    background: #ff6666;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.search-result-card {
    background: #2a2a2a;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    aspect-ratio: 1;
}

.search-result-card:hover {
    border-color: #ff4444;
    transform: scale(1.03);
}

.search-result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-loading {
    text-align: center;
    color: #888;
    padding: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.search-error {
    color: #ff4444;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2em;
    margin-top: 8px;
}

.search-next-btn {
    display: block;
    margin: 16px auto 0;
    background: #2a2a2a;
    border: 2px solid #444;
    color: #ccc;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.search-next-btn:hover {
    border-color: #ff4444;
    color: #fff;
}

.upload-card .upload-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.upload-card .upload-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(1);
}

.upload-card .upload-btn:hover {
    opacity: 1;
}
