/* ========================================
   COLOR PALETTE — black, white, and grays only.
   Defined once here, used everywhere below.
   Uses off-white/charcoal instead of pure white/black,
   which is softer on the eyes than full contrast.
   ======================================== */
:root {
    --color-white: #FFFFFF;      /* pure white (cards, button text) */
    --color-light-gray: #E8E8E8; /* light gray (background, borders) */
    --color-mid-gray: #9A9A9A;   /* mid gray (secondary text, buttons) */
    --color-dark: #2B2B2B;       /* near-black (headings, primary text) */
}

footer p {
    color: var(--color-dark);
}

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

/* Background with animated gradient */
body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-mid-gray), var(--color-dark));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Container */
.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(43, 43, 43, 0.15);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Header */
header {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 30px 20px;
    text-align: center;
}

header h1 {
    font-size: 34px;
    margin-bottom: 5px;
    letter-spacing: 1px;
    animation: fadeInDown 1s ease;
}

header .subtitle {
    font-size: 15px;
    opacity: 0.75;
    animation: fadeInUp 1.2s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main */
main {
    padding: 30px 20px;
}

/* Weather Card with glass effect */
.weather-card {
    background: var(--color-white);
    border: 1px solid var(--color-light-gray);
    padding: 40px 20px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(43, 43, 43, 0.08);
}

/* Weather text */
.city {
    font-size: 26px;
    color: var(--color-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.temperature {
    font-size: 72px;
    color: var(--color-dark);
    font-weight: bold;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.condition-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
    filter: grayscale(100%) contrast(1.3) brightness(0.85);
}

.condition {
    font-size: 22px;
    color: var(--color-dark);
    margin-bottom: 5px;
}

.description {
    font-size: 15px;
    /* color: var(--color-dark); */
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 20px rgba(43, 43, 43, 0.4);
}

.btn-secondary {
    background: var(--color-mid-gray);
    color: var(--color-white);
}

.btn-secondary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 20px rgba(154, 154, 154, 0.5);
}

/* Status messages */
.status {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.status.success {
    display: block;
    background: var(--color-light-gray);
    color: var(--color-dark);
    border: 1px solid var(--color-mid-gray);
}

.status.error {
    display: block;
    background: var(--color-white);
    color: var(--color-dark);
    border: 1px solid var(--color-dark);
}

/* Offline indicator */
.offline-indicator {
    padding: 15px;
    background: var(--color-light-gray);
    border: 1px solid var(--color-mid-gray);
    color: var(--color-dark);
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.offline-indicator.hidden {
    display: none;
}

/* Debug coordinates box */
.debug-coords {
    margin-top: 15px;
    padding: 8px 10px;
    background: var(--color-white);
    color: var(--color-dark);
    font-family: monospace;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-mid-gray);
    word-break: break-all;
}

.debug-coords a {
    color: var(--color-dark);
    font-weight: 600;
    text-decoration: underline;
}

.debug-coords.hidden {
    display: none;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    text-align: center;
    font-size: 13px;
    color: var(--color-mid-gray);
    border-top: 1px solid var(--color-light-gray);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    header h1 {
        font-size: 28px;
    }

    .temperature {
        font-size: 56px;
    }

    .button-group {
        grid-template-columns: 1fr;
    }
}
