* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-filter input[type="text"],
.search-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#reviewed-filter {
    margin-left: 15px;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#status {
    font-size: 14px;
    color: #7f8c8d;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.item-list {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.item-list h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.item-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.item-card:hover {
    background-color: #f8f9fa;
}

.item-card.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.item-card.recently-saved {
    background-color: #d4edda;
}

.item-card .item-index {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.item-card .tool-label {
    display: inline-block;
    background-color: #2ecc71;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.item-card.query {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.item-detail {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.item-detail h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    margin-top: 5px;
    border: 1px solid #dee2e6;
    white-space: pre-wrap;
}

#save-item-btn {
    background-color: #2ecc71;
}

#save-item-btn:hover {
    background-color: #27ae60;
}

#item-status {
    margin-left: 10px;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#page-info {
    font-size: 14px;
    color: #7f8c8d;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .search-filter,
    .actions {
        justify-content: center;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    background-color: #2ecc71;
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 300px;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.warning {
    background-color: #f39c12;
}