.unit-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.unit-label {
    font-family: 'Verdana', sans-serif;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.unit-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #2196F3;
    border-radius: 20px;
    background: transparent;
    color: #fff;
    font-family: 'Verdana', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unit-btn:hover {
    background: rgba(33, 150, 243, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.unit-btn.active {
    background: #2196F3;
    color: #fff;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.unit-btn:not(.active) {
    opacity: 0.7;
}

.unit-btn:not(.active):hover {
    opacity: 1;
}

.unit-text {
    font-size: 14px;
    color: #333;
    min-width: 60px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.alert-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.alert-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.alert-item p {
    margin: 0;
    color: #666;
}

#alerts-container {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#alerts-container.hidden {
    display: none;
}

.weather-card.current-conditions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.weather-card.current-conditions .weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.weather-card.current-conditions .detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.weather-card.current-conditions .detail-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.weather-card.current-conditions .detail-item span:first-child {
    min-width: 120px;
    color: #fff;
    font-weight: 500;
}

.weather-card.current-conditions .detail-item span:nth-child(2) {
    flex: 1;
    color: #fff;
    font-weight: 600;
}

.weather-card.current-conditions .graph-icon {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.weather-card.current-conditions .graph-icon:hover {
    opacity: 1;
}

#custom-alerts-container {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 95vw;
    max-width: 420px;
    pointer-events: none;
}

.custom-alert {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 28px 22px 20px;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 8px rgba(0,0,0,0.10);
    color: #fff;
    font-size: 1.13em;
    font-weight: 600;
    pointer-events: auto;
    margin: 0 auto;
    position: relative;
    background: rgba(30, 30, 40, 0.65);
    backdrop-filter: blur(8px) saturate(1.2);
    border-left: 7px solid #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: fadeInUp 0.7s cubic-bezier(.23,1.01,.32,1) both;
}

.custom-alert.rainbow {
    border-left: 7px solid #ff5e62;
    background: linear-gradient(120deg, rgba(255,94,98,0.85) 0%, rgba(249,212,35,0.85) 40%, rgba(67,206,162,0.85) 80%, rgba(25,118,210,0.85) 100%);
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.custom-alert.poweroutage {
    border-left: 7px solid #ffeb3b;
    background: linear-gradient(120deg, rgba(34,34,34,0.92) 0%, rgba(255,235,59,0.85) 100%);
    color: #222;
    text-shadow: 0 2px 8px rgba(255,255,255,0.10);
}

.custom-alert .alert-icon {
    font-size: 2.2em;
    margin-right: 10px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

.custom-alert .close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: inherit;
    font-size: 1.5em;
    cursor: pointer;
    margin-left: 18px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: background 0.2s, opacity 0.2s, transform 0.2s;
    position: absolute;
    top: 10px;
    right: 10px;
    pointer-events: auto;
}
.custom-alert .close-btn:hover {
    background: rgba(255,255,255,0.35);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.98);}
    100% { opacity: 1; transform: translateY(0) scale(1);}
}

body {
    font-size: 16px;
}
.container, .cards-container, .weather-grid, .row {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
}
.weather-card, .weather-card.current-conditions, .weather-card.radar-card, .weather-card.moon-phases, .weather-card.alert-map, .weather-card.cameras-section, .weather-card.sun-times, .weather-card.rip-current {
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px 0;
    padding: 12px;
    box-sizing: border-box;
}
.weather-grid, .forecast, .cameras-grid, .row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.forecast-day, .camera-feed {
    width: 100%;
    max-width: 100%;
}
.menu-button, .notification-button, .reload-button, .compare-button, .close-graph, .modal-close {
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
}
.unit-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
}
@media (max-width: 600px) {
    body {
        font-size: 16px;
    }
    .container, .cards-container, .weather-grid, .row {
        padding: 0 4px;
    }
    .weather-card {
        padding: 8px;
    }
    .main-temp {
        font-size: 2em;
    }
    .weather-icon-container img {
    display: flex;
    width: 128px;
    height: auto;
    border-radius: 10px;
    justify-content: center;
    margin: auto;
    align-items: center;
    margin-bottom: 30px;
    }
    .forecast-title, h1, h2, h3 {
        font-size: 1.1em;
    }
    .current-conditions {
        cursor: pointer;
        min-height: 88px;
        padding: 16px 8px 32px 8px;
        border-radius: 12px;
        position: relative;
        transition: box-shadow 0.2s, background 0.2s;
        outline: none;
    }
    .current-conditions:active, .current-conditions:focus {
        box-shadow: 0 0 0 4px #2196F333, 0 2px 8px rgba(0,0,0,0.08);
        background: #e3f2fd;
    }
    .current-conditions::after {
        content: 'Tap for more details';
        position: absolute;
        bottom: 10px;
        right: 15px;
        font-size: 0.9em;
        color: #666;
        background: rgba(255,255,255,0.8);
        padding: 6px 14px;
        border-radius: 16px;
        pointer-events: none;
        z-index: 2;
    }
}

.dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 180px; /* Adjust this value to position it next to the unit toggle */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.dark-mode-label {
    font-family: 'Verdana', sans-serif;
    font-weight: bold !important;
    color: #333;
    font-size: 0.8rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme='dark'] body {
    background-color: #121212;
    color: #ffffff;
}

[data-theme='dark'] .weather-card {
    background: #1e1e1e;
    color: #ffffff;
}

[data-theme='dark'] .weather-card:hover {
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

[data-theme='dark'] .forecast-day {
    background: #1e1e1e;
    color: #ffffff;
}

[data-theme='dark'] .detail-item {
    border-bottom: 1px solid #333;
}

[data-theme='dark'] .detail-item:hover {
    background-color: #333;
}

[data-theme='dark'] .header {
    color: #ffffff;
}

[data-theme='dark'] .credits {
    color: #aaa;
}

[data-theme='dark'] .bible-verse {
    color: #aaa;
}

[data-theme='dark'] .sun-times {
    background: linear-gradient(to bottom, #1e1e1e, #2c2c2c);
}

[data-theme='dark'] .sun-times h3 {
    color: #ffffff;
}

[data-theme='dark'] .time-labels {
    color: #aaa;
}

[data-theme='dark'] .day-length {
    color: #aaa;
}

[data-theme='dark'] .unit-toggle {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme='dark'] .unit-label {
    color: #ffffff;
}

[data-theme='dark'] .unit-btn {
    color: #ffffff;
    border: 1px solid #2196F3;
}

[data-theme='dark'] .unit-btn.active {
    background: #2196F3;
    color: #ffffff;
}

[data-theme='dark'] .dark-mode-toggle {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme='dark'] .dark-mode-label {
    color: #ffffff;
}

[data-theme='dark'] .menu-button {
    background: #1e1e1e;
    color: #ffffff;
}

[data-theme='dark'] .menu-popup {
    background: #1e1e1e;
    color: #ffffff;
}

[data-theme='dark'] .menu-item {
    color: #ffffff;
}

[data-theme='dark'] .menu-item:hover {
    background-color: #333;
}

[data-theme='dark'] .weather-graph {
    background: #1e1e1e;
    border: 1px solid #333;
}

[data-theme='dark'] .graph-header {
    border-bottom: 1px solid #333;
}

[data-theme='dark'] .graph-title {
    color: #ffffff;
}

[data-theme='dark'] .close-graph {
    color: #aaa;
}

[data-theme='dark'] .close-graph:hover {
    color: #ffffff;
}

[data-theme='dark'] .modal-content {
    background-color: #1e1e1e;
    color: #ffffff;
}

[data-theme='dark'] .modal-header {
    border-bottom: 1px solid #333;
}

[data-theme='dark'] .modal-close {
    color: #aaa;
}

[data-theme='dark'] .modal-close:hover {
    color: #ffffff;
}

[data-theme='dark'] .station-card {
    background: #2c2c2c;
}

[data-theme='dark'] .station-name {
    color: #ffffff;
}

[data-theme='dark'] .station-distance {
    color: #aaa;
}

[data-theme='dark'] .comparison-item {
    background: #1e1e1e;
}

[data-theme='dark'] .comparison-label {
    color: #aaa;
}

[data-theme='dark'] .comparison-value {
    color: #ffffff;
}