html,
body {
    height: 100%;
    margin: 0;
}

.main-container {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100vh;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 15px;
}

.layers-container {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#layersContainer > h3 {
    width: 100%;
    flex-basis: 100%;
    margin: 4px;
}

.layer-section {
    flex: 1;
    border: 1px solid #999;
    padding: 10px;
    border-radius: 4px;
}
.layer-section[data-section="extent"] {
    order: 1;
}

.layer-section[data-section="sheets"] {
    order: 2;
}
.layer-section-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.layer-section.section-disabled {
    background-color: #f5f5f5;
    opacity: 0.6;
}

.layer-section.section-disabled:hover {
    cursor: not-allowed;
}

#map {
    flex: 1;
    min-height: 0;
}

.layer-label {
    display: block;
    padding: 5px;
}

.layer-image {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    vertical-align: middle;
}

.error-message {
    color: red;
}

.popup-features-container {
    max-height: 320px;
    max-width: 320px;
    min-width: 250px;
    overflow-y: scroll;
    overflow-x: hidden;
    font-size: 14px;
    word-wrap: break-word;
    display: block;
}

.popup-feature-item {
    border-bottom: 1px solid #ccc;
    padding: 8px 0;
}

.popup-download-link {
    color: #0066cc;
}

.popup-send-button {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 6px;
}

.popup-send-button:hover {
    background-color: #0052a3;
}

.popup-send-button:active {
    background-color: #003d7a;
}

.popup-send-button:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.popup-send-button.loading {
    position: relative;
}

.popup-send-button.loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    right: 8px;
    margin-top: -6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

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

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    margin-top: 15px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: #333;
    min-width: 150px;
}

.status-value {
    color: #666;
    word-break: break-all;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #0066cc;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    transition: width 0.3s ease;
}

.progress-bar.progress-bar-animated .progress-bar-fill {
    animation: progress-bar-stripes 2s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 0;
    }
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.ready {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

.tile-endpoint-copy {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.copy-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.copy-button:hover {
    background-color: #218838;
}

.copy-button:active {
    background-color: #1e7e34;
}

.tile-endpoint-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    min-height: 80px;
    resize: vertical;
    word-break: break-all;
    white-space: pre-wrap;
    font-family: monospace;
}
.status-content {
    flex: 1;
    margin: 10px;
}

.endpoint-note {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.status-label-130px {
    width: 130px;
}

.status-label-180px {
    width: 180px;
}