* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background-color: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.search-panel {
    padding: 1.5rem;
}

.search-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

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

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

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

.btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
    width: 100%;
}

.btn-success:hover {
    background-color: #229954;
}

.filter-actions {
    margin-top: 2rem;
}

.filter-actions .btn-secondary {
    width: 100%;
    margin-top: 0.5rem;
}

.info-text {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #ecf0f1;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    display: none;
}

.status-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-container {
    height: 50%;
    position: relative;
    border-bottom: 2px solid #ddd;
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    max-width: 300px;
}

.results-container {
    height: 50%;
    background-color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
}

.results-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-header h2 {
    font-size: 1.2rem;
    color: #2c3e50;
}

#results-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 3rem;
    font-style: italic;
}

.result-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.result-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.result-item .item-header {
    cursor: pointer;
}

.result-item h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.result-item .item-id {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.result-item .item-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.result-item .meta-tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: #ecf0f1;
    border-radius: 3px;
    color: #555;
}

.result-item .item-bbox {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Download buttons */
.item-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ecf0f1;
}

.btn-download {
    background-color: #16a085;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-download:hover {
    background-color: #138d75;
}

.btn-download-bulk {
    background-color: #16a085;
    color: white;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.btn-download-bulk:hover {
    background-color: #138d75;
}
