/* GOES Viewer Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    height: 50px;
    z-index: 1000;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e94560;
}

.legal-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #0f3460;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.legal-btn:hover, .legal-btn.active {
    background: #0f3460;
    color: #e0e0e0;
}

/* Controls */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dropdown-container {
    position: relative;
}

.dropdown-btn {
    padding: 6px 12px;
    background: #0f3460;
    border: 1px solid #1a1a2e;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.dropdown-btn:hover, .dropdown-btn.active {
    background: #e94560;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 4px;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    margin-top: 4px;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background: #0f3460;
}

/* Main content */
.main-content {
    display: flex;
    height: calc(100vh - 50px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #16213e;
    border-right: 1px solid #0f3460;
    padding: 16px;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #e94560;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #aaa;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 8px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.85rem;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #e94560;
}

.control-group select option {
    background: #1a1a2e;
}

.control-group select optgroup {
    background: #16213e;
    color: #e94560;
    font-weight: bold;
}

.date-time-row {
    display: flex;
    gap: 8px;
}

.date-time-row > div {
    flex: 1;
}

.date-time-row > div:first-child {
    flex: 2;
}

.fetch-btn {
    width: 100%;
    padding: 12px;
    background: #e94560;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
}

.fetch-btn:hover:not(:disabled) {
    background: #ff6b6b;
}

.fetch-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Status message */
#status-message {
    margin-top: 12px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
}

#status-message.loading {
    background: #0f3460;
    color: #4cc9f0;
}

#status-message.success {
    background: #1a472a;
    color: #4ade80;
}

#status-message.error {
    background: #4a1a1a;
    color: #f87171;
}

/* Map container */
#map {
    flex: 1;
    background: #1a1a2e;
}

/* Legend */
#legend {
    display: none;
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid #0f3460;
    border-radius: 4px;
    padding: 10px;
    z-index: 1000;
    min-width: 80px;
}

#legendTitle {
    font-size: 0.75rem;
    margin-bottom: 8px;
    text-align: center;
    color: #e0e0e0;
}

.legend-content {
    display: flex;
    gap: 8px;
}

#legendBar {
    width: 20px;
    height: 150px;
    background: linear-gradient(to bottom, white, black);
    border-radius: 2px;
}

#legendLabels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #aaa;
}

/* Cursor value display */
#cursorValue {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid #0f3460;
    border-radius: 4px;
    padding: 6px 12px;
    z-index: 1000;
    font-size: 0.85rem;
}

#cursorValue.show {
    display: block;
}

/* Overlay settings */
.overlay-item {
    padding: 8px 12px;
    border-bottom: 1px solid #0f3460;
}

.overlay-item:last-child {
    border-bottom: none;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.overlay-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Options dropdown */
.options-dropdown {
    min-width: 200px;
}

.options-item {
    padding: 8px 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.setting-row span {
    flex-shrink: 0;
}

.setting-row input[type="number"] {
    width: 60px;
    padding: 4px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.8rem;
}

.setting-row input[type="range"] {
    flex: 1;
}

.opacity-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.opacity-slider-container input {
    flex: 1;
}

.opacity-slider-container span {
    width: 40px;
    text-align: right;
    font-size: 0.8rem;
}

/* Legal Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-content h2 {
    color: #e94560;
    margin-bottom: 16px;
}

.modal-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.9rem;
}

.modal-content a {
    color: #4cc9f0;
}

.modal-close-btn {
    margin-top: 16px;
    padding: 8px 16px;
    background: #e94560;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: #ff6b6b;
}

/* Leaflet customizations */
.leaflet-control-zoom {
    border: 1px solid #0f3460 !important;
}

.leaflet-control-zoom a {
    background: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #0f3460 !important;
}

.leaflet-control-zoom a:hover {
    background: #0f3460 !important;
}

.leaflet-control-scale-line {
    background: rgba(22, 33, 62, 0.8) !important;
    border-color: #0f3460 !important;
    color: #e0e0e0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .main-content {
        flex-direction: column;
    }
}
