body {
    font-family: Arial, sans-serif;
    margin: 10px;
    background: #1a1a2e;
    color: white;
}

header {
    text-align: center;
    margin-bottom: 15px;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.search-section {
    background: white;
    color: #333;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.search-section h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.search-bar {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.search-bar:focus {
    outline: none;
    border-color: #3498db;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 3px;
    color: #2c3e50;
    font-size: 0.8rem;
}

.filter-group select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-clear {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #e74c3c;
    color: white;
    margin-bottom: 10px;
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.page-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #3498db;
    color: white;
}

.page-btn:hover:not(:disabled) {
    background: #2980b9;
}

.page-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.page-size {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}

.page-size:focus {
    outline: none;
    border-color: #3498db;
}

.results-section {
    margin-top: 10px;
}

.results-label {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
    max-height: 500px;
    overflow-y: auto;
    padding: 8px;
    background: transparent;
    border-radius: 4px;
}

.results-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: #7f8c8d;
    padding: 30px 15px;
    font-size: 0.9rem;
}

.result-card {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0;
    cursor: grab;
}

.result-card:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

.result-card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.result-card-image.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.result-card-image:not(.lazy) {
    opacity: 1;
}

.result-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.btn-action {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-action:hover {
    background: #229954;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr;
    gap: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.card-panel,
.interaction-panel {
    background: white;
    color: #333;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-panel h2,
.interaction-panel h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 6px;
    font-size: 1.1rem;
}

.drop-zone.drop-active {
    background: #e8f4f8;
    border: 2px dashed #3498db;
}

.slot-hint {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.95rem;
    padding: 40px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px dashed #bdc3c7;
    margin: 0;
}

.card-content {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.selected-card-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    display: block;
    border-radius: 6px;
}

.btn-remove {
    margin-top: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #e74c3c;
    color: white;
    width: 100%;
}

.btn-remove:hover {
    background: #c0392b;
}

.interaction-panel {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.interaction-output {
    margin: 15px 0;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    min-height: 100px;
    color: #7f8c8d;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .filters {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 400px) {
    .filters {
        grid-template-columns: 1fr;
    }
}