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

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .page {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #1f2937;
}

body.dark-mode .current-weather-container {
    color: #e0e0e0;
}

body.dark-mode .chart-container {
    background-color: #5d5d5d;
    border-color: #404040;
}

body.dark-mode .chart-legend {
    background-color: #5d5d5d;
}

body.dark-mode .setting-group select,
body.dark-mode .setting-group input {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-mode .alert-item {
    background-color: #3a3a1a;
    color: #e0e0e0;
}

body.dark-mode .alert-item.severe {
    background-color: #3a1a1a;
}

body.dark-mode .alert-event,
body.dark-mode .alert-description {
    color: #e0e0e0;
}

body.dark-mode .alert-time,
body.dark-mode .alert-sender {
    color: #b0b0b0;
}

body.dark-mode .error {
    background-color: #2d2d2d;
    color: #ff6b6b;
}

body.dark-mode .loading {
    color: #b0b0b0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #465a6c 0%, #3d5267 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.nav-title h1 {
    font-size: 24px;
    margin: 0;
}

.location-name {
    font-size: 14px;
    color: #bdc3c7;
    margin-top: 2px;
    font-weight: normal;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons:hover {
    background-color: white;
    color: #2c3e50;
    transform: rotate(45deg);
}

.action-buttons.active {
    background-color: white;
    color: #2c3e50;
}

.zoom-container {
    position: relative;
}

.zoom-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 2px solid #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 1000;
    color: #333;
}

body.dark-mode .zoom-menu {
    background-color: #2d2d2d;
    border-color: #4a6fa5;
    color: #e0e0e0;
}

.zoom-menu.hidden {
    display: none;
}

.zoom-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #ddd;
}

body.dark-mode .zoom-menu-item {
    border-bottom-color: #404040;
}

.zoom-menu-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.zoom-menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.zoom-menu-item:hover {
    background-color: #f0f0f0;
}

body.dark-mode .zoom-menu-item:hover {
    background-color: #3a3a3a;
}

.page {
    display: none;
    background-color: white;
    border-radius: 8px;
    padding: 0px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page.active {
    display: block;
}

.current-weather-container {
    padding: 5px 15px;
    margin-bottom: 5px;
    background: linear-gradient(
        135deg,
        rgba(52, 73, 94, 0.55) 0%,
        rgba(44, 62, 80, 0.2) 100%
    );
    border-radius: 8px;
    color: #2c3e50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.current-weather-container.hidden {
    display: none;
}

.current-weather-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    align-items: center;
}

.current-weather-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.current-temp {
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
    justify-self: end;
}

.weather-table {
    display: flex;
    gap: 0px;
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    max-width: 200px;
    justify-content: flex-end;
}

.weather-table-data {
    justify-self: end;
}

.current-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.current-condition {
    font-size: 16px;
    font-weight: 500;
}

.current-feels-like {
    font-size: 13px;
    opacity: 0.9;
}

.current-weather-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 300px;
    justify-self: end;
}

.weather-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.weather-stat-label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-stat-value {
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .current-weather-grid {
        grid-template-columns: 2fr 2fr;
        gap: 12px;
    }

    .current-temp {
        font-size: 36px;
    }
}

.chart-container {
    width: 100%;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#chartContainer {
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0px;
    height: 500px;
    max-height: calc(100vh - 350px);
    position: relative;
    z-index: 1;
}

#chartContainer2 {
    height: 100px;
    border-top: none;
    border-radius: 0 0 4px 4px;
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    #chartContainer {
        height: 400px;
        max-height: calc(100vh - 300px);
    }
}

@media (max-height: 800px) {
    #chartContainer {
        height: 350px;
        max-height: calc(100vh - 280px);
    }
}

@media (max-height: 700px) {
    #chartContainer {
        height: 300px;
        max-height: calc(100vh - 260px);
    }
}

@media (max-height: 600px) {
    #chartContainer {
        height: 250px;
        max-height: calc(100vh - 240px);
    }
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.temperature-color {
    background-color: #e74c3c;
}

.precipitation-color {
    background-color: #3498db;
    opacity: 0.6;
}

.info-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-bar-label {
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

.info-bar {
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
    position: relative;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-column h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

body.dark-mode .settings-column h3 {
    color: #e0e0e0;
    border-bottom-color: #4a6fa5;
}

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

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 500px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .settings-column h3 {
        font-size: 16px;
    }
}

.save-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background-color: #219a52;
}

.loading {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #666;
}

.error {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #e74c3c;
    background-color: #f8f8f8;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

.alerts-container {
    margin-top: 20px;
}

.alerts-container.hidden {
    display: none;
}

.alert-item {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-item.severe {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.alert-event {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.alert-sender {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.alert-time {
    font-size: 12px;
    color: #666;
}

.alert-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.alert-tags {
    margin-top: 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.alert-tag {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #555;
}

.page-footer {
    text-align: left;
    padding: 0px 20px;
    margin-top: 0px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-github {
    display: inline-flex;
    align-items: center;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.footer-github:hover {
    opacity: 1;
}

.footer-github img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    display: block;
}

body.dark-mode .footer-github img {
    filter: invert(1);
}

.footer-provider {
    font-size: 11px;
    color: #666;
    font-family: monospace;
}

body.dark-mode .footer-provider {
    color: #999;
}
