/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    padding: 20px;
    position: relative;
}

.settings-button {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.settings-button:hover {
    transform: scale(1.05);
}

.data-status {
    font-size: 0.9rem;
    margin: 6px 0 12px;
}

.data-status.live {
    color: #1b8f3a;
}

.data-status.stale {
    color: #d97706;
}

.settings-panel {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px auto 20px;
    max-width: 480px;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: none;
}

.settings-panel.is-open {
    display: block;
}

.settings-title {
    font-size: 1.1rem;
    margin: 0 0 10px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.settings-grid input {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.settings-actions button {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background-color: #2196F3;
    color: #fff;
    cursor: pointer;
}

.settings-actions button:last-child {
    background-color: #6b7280;
}

.settings-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
}

/* Dark Mode Toggle (Switch Style) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.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: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

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

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Weather Cards Container */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

/* Individual Cards */
.card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    min-width: 220px;
}

/* Hover Effect */
.card:hover {
    transform: scale(1.05);
}

/* Dark Mode */
.dark-mode {
    background-color: #333;
    color: white;
}

.dark-mode .card {
    background-color: #444;
    color: white;
}

.dark-mode .settings-button {
    background-color: #444;
    color: #f9fafb;
}

.dark-mode .settings-panel {
    background-color: #444;
    color: white;
}

.dark-mode .settings-grid input {
    background-color: #555;
    color: white;
    border-color: #666;
}

.dark-mode .settings-note {
    color: #d1d5db;
}

.sparkline {
    width: 120px;
    height: 30px;
    margin: 6px auto 12px;
}

.sparkline svg {
    width: 100%;
    height: 100%;
}

.sparkline polyline {
    fill: none;
    stroke: #2196F3;
    stroke-width: 2;
}

.dark-mode .sparkline polyline {
    stroke: #60a5fa;
}

.flash {
    animation: flashAnimation 1s ease-in-out;
}

@keyframes flashAnimation {
    0% { background-color: #666; } /* Light gray for dark mode */
    100% { background-color: transparent; }
}
