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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #0a1929;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

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

header {
    background: linear-gradient(135deg, #0a1929 0%, #122c4a 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 150, 255, 0.2);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #64b5f6, #4fc3f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0066cc 0%, #0099ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 153, 255, 0.4);
}

.logo-icon i {
    font-size: 20px;
    color: white;
}

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

.header-controls a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(0, 100, 200, 0.3);
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.header-controls a:hover {
    background: rgba(0, 100, 200, 0.5);
}

.map-container {
    flex: 1;
    position: relative;
    background: #0a1929;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.control-panel {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: rgba(16, 34, 60, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 181, 246, 0.2);
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #64b5f6;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(100, 181, 246, 0.3);
}

.section-title i {
    font-size: 1.1rem;
    color: #4fc3f7;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.9rem;
    color: #90caf9;
    font-weight: 500;
}

input {
    padding: 0.85rem;
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    background: rgba(12, 28, 50, 0.7);
    transition: all 0.2s ease;
    color: white;
}

input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

input[type="date"] {
    padding: 0.8rem;
}

/* White calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem;
    background: rgba(12, 28, 50, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(100, 181, 246, 0.3);
    color: #bbdefb;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c5282;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0ea5e9;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.events-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 10px;
    background: rgba(12, 28, 50, 0.5);
}

.event-list {
    list-style: none;
}

.event-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(100, 181, 246, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-item:hover {
    background: rgba(25, 118, 210, 0.2);
}

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

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.event-name {
    font-weight: 500;
    flex: 1;
    font-size: 1.05rem;
    color: #e3f2fd;
}

.event-type {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
}

.event-coords {
    font-size: 0.85rem;
    color: #90caf9;
}

.event-item.active {
    background: rgba(25, 118, 210, 0.3);
    border-left: 4px solid #4fc3f7;
}

.status-bar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(16, 34, 60, 0.9);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 181, 246, 0.2);
    color: #bbdefb;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.event-info {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(16, 34, 60, 0.9);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    width: 320px;
    display: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(100, 181, 246, 0.2);
}

.event-info.active {
    display: block;
}

.event-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.event-info-header h3 {
    font-size: 1.3rem;
    color: #4fc3f7;
}

.close-info {
    cursor: pointer;
    font-size: 1.5rem;
    color: #90caf9;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-info:hover {
    background: rgba(25, 118, 210, 0.3);
    color: #e3f2fd;
}

.event-thumbnail {
    width: 100%;
    height: 180px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.event-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #e3f2fd;
}

.event-detail-label {
    font-weight: 600;
    color: #90caf9;
}

.event-detail-value {
    color: #e3f2fd;
    word-break: break-word;
}

.color-map-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.color-map-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(12, 28, 50, 0.5);
    border: 1px solid rgba(100, 181, 246, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-map-item:hover {
    background: rgba(25, 118, 210, 0.3);
    transform: translateY(-3px);
}

.color-map-item.active {
    background: rgba(25, 118, 210, 0.5);
    border-color: #4fc3f7;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.color-map-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.color-map-label {
    font-size: 0.8rem;
    color: #bbdefb;
    text-align: center;
}

.fire, .event-type {
    background: #f44336;
    color: #fff;
}

.flood .event-type {
    background: #2196f3;
    color: #fff;
}

.storm .event-type {
    background: #ff9800;
    color: #fff;
}

.drought .event-type {
    background: #ffc107;
    color: #333;
}

.volcano .event-type {
    background: #9c27b0;
    color: #fff;
}

@media (max-width: 768px) {
    .control-panel {
        width: calc(100% - 2rem);
        left: 1rem;
        top: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .event-info {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        bottom: 4.5rem;
    }
    
    .status-bar {
        width: 90%;
        text-align: center;
    }
}

.info-text {
    font-size: 0.85rem;
    color: #90caf9;
    font-style: italic;
    margin-top: 0.25rem;
}

.event-link {
    color: #4fc3f7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.event-link:hover {
    text-decoration: underline;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(12, 28, 50, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 181, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 181, 246, 0.7);
}

.visualization-info {
    background: rgba(25, 118, 210, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #bbdefb;
}