@import url(location.css);

:root {
    --bg-deep: #050a14;
    --cyan: #00d4ff;
    --cyan-dim: #4db8e8;
    --cyan-glow: rgba(0, 212, 255, 0.35);
    --text-primary: #f0f6ff;
    --text-muted: #8eb4d4;
    --card-bg: rgba(6, 18, 42, 0.72);
    --card-border: rgba(0, 200, 255, 0.28);
    --sunrise: #ffd54f;
    --sunset: #ff8c2a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rajdhani', 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100vh;
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(0, 100, 200, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(0, 180, 255, 0.08) 0%, transparent 50%);
    color: var(--text-primary);
    overflow-x: hidden;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 160, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 160, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
    pointer-events: none;
}

.glow-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
    z-index: 1;
    pointer-events: none;
}

.app {
    position: relative;
    z-index: 2;
    width: 96%;
    max-width: 1380px;
    margin: 24px auto;
    padding: 20px 24px 28px;
}

/* Header */
.top-bar {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 480px) 1fr;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo-icon {
    color: var(--cyan);
    font-size: 26px;
    filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.logo-section p {
    font-size: 13px;
    font-weight: 600;
    color: var(--cyan-dim);
    letter-spacing: 2.5px;
    margin-top: 2px;
    text-transform: uppercase;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(4, 12, 28, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.08);
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 14px 14px 40px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: var(--cyan);
    border: none;
    color: #041018;
    padding: 0 22px;
    min-width: 52px;
    min-height: 52px;
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
    transition: filter 0.2s;
}

.search-box button:hover {
    filter: brightness(1.1);
}

.time-display {
    text-align: right;
    justify-self: end;
}

.time-display .date {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.time-display .time {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 1px;
}

.time-display .day {
    font-size: 15px;
    font-weight: 500;
    color: var(--cyan-dim);
    margin-top: 2px;
}

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 22px;
}

.weather-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 22px 24px 20px;
    box-shadow:
        0 0 40px rgba(0, 140, 255, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cyan-dim);
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Current weather */
.location {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-primary);
}

.location i {
    color: var(--cyan);
    font-size: 16px;
}

.weather-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 6px;
}

.temp-main {
    font-size: 88px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -2px;
}

.weather-icon-lg {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.weather-icon-lg .fa-sun { color: #ffd54f; }
.weather-icon-lg .fa-cloud-sun { color: #90caf9; }
.weather-icon-lg .fa-cloud { color: #b0bec5; }
.weather-icon-lg .fa-cloud-rain,
.weather-icon-lg .fa-cloud-showers-heavy { color: #64b5f6; }
.weather-icon-lg .fa-snowflake { color: #e3f2fd; }
.weather-icon-lg .fa-bolt { color: #ffeb3b; }
.weather-icon-lg .fa-smog { color: #9e9e9e; }

.condition {
    font-size: 18px;
    font-weight: 500;
    color: var(--cyan);
    text-align: center;
    margin-bottom: 24px;
}

.current-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
    margin-bottom: 22px;
    padding: 0 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-item i {
    font-size: 20px;
    color: var(--cyan);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.detail-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.2;
}

.detail-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.sun-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    border-top: 1px solid rgba(0, 180, 255, 0.15);
    padding-top: 18px;
}

.sun-block {
    text-align: center;
    padding: 14px 10px 12px;
    background: rgba(0, 20, 45, 0.5);
    border: 1px solid rgba(0, 180, 255, 0.15);
    border-radius: 12px;
}

.sun-visual {
    font-size: 30px;
    margin-bottom: 6px;
    line-height: 1;
}

.sunrise-block .sun-visual i {
    color: var(--sunrise);
    filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.4));
}

.sunset-block .sun-visual i {
    color: var(--sunset);
    filter: drop-shadow(0 0 10px rgba(255, 140, 42, 0.4));
    transform: rotate(180deg);
    display: inline-block;
}

.sun-block .label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.sun-block .value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
    color: var(--text-primary);
}

/* Forecast */
.forecast-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.forecast-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
}

.forecast-table th {
    text-align: left;
    padding: 10px 12px 14px;
    color: var(--cyan-dim);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.2);
}

.forecast-table td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.1);
    font-size: 16px;
    font-weight: 500;
    vertical-align: middle;
}

.forecast-table tbody tr:last-child td {
    border-bottom: none;
}

.forecast-day {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.forecast-day .day-name {
    color: var(--text-primary);
}

.forecast-day .day-date {
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-condition {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forecast-icon {
    font-size: 26px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.forecast-icon.fa-sun { color: #ffd54f; }
.forecast-icon.fa-cloud-sun { color: #90caf9; }
.forecast-icon.fa-cloud { color: #b0bec5; }
.forecast-icon.fa-cloud-rain,
.forecast-icon.fa-cloud-showers-heavy { color: #64b5f6; }
.forecast-icon.fa-snowflake { color: #e3f2fd; }
.forecast-icon.fa-bolt { color: #ffeb3b; }

.forecast-temp {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.forecast-sun {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-sun .fa-sun {
    color: var(--sunrise);
    font-size: 14px;
}

.forecast-sun .sunset-icon {
    color: var(--sunset);
    font-size: 14px;
    transform: rotate(180deg);
    display: inline-block;
}

/* Install panel */
.install-panel {
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(0, 20, 45, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.2);
    text-align: center;
}

.install-tag {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--cyan);
    margin-bottom: 8px;
}

.install-desc {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 640px;
    margin: 0 auto 14px;
}

.install-guide {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 180, 255, 0.15);
    text-align: left;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.install-guide p {
    margin-bottom: 8px;
}

.install-guide p:last-child {
    margin-bottom: 0;
}

.install-guide strong {
    color: var(--text-primary);
}

.install-guide em {
    color: var(--cyan-dim);
    font-style: normal;
}

/* App actions */
.app-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(0, 20, 45, 0.55);
    color: var(--cyan-dim);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.action-btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #041018;
}

.action-btn-primary:hover {
    filter: brightness(1.08);
    color: #041018;
}

.action-btn:hover {
    background: rgba(0, 40, 70, 0.65);
    border-color: rgba(0, 212, 255, 0.45);
    color: var(--text-primary);
}

.action-btn.active {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.action-btn.hidden {
    display: none;
}

/* Footer */
.footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-copy {
    justify-self: start;
    line-height: 1.5;
}

.footer-version {
    justify-self: center;
    padding: 6px 20px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    color: var(--cyan-dim);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 12px;
    background: rgba(0, 20, 45, 0.4);
}

.footer-data {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.footer-data i {
    color: var(--cyan);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1100px) {
    .top-bar {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .logo-section h1 {
        justify-content: center;
    }

    .time-display {
        text-align: center;
        justify-self: center;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app {
        width: 100%;
        margin: 0;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
    }

    .grid-overlay {
        background-size: 36px 36px;
    }

    .top-bar {
        gap: 16px;
        margin-bottom: 20px;
    }

    .logo-section h1 {
        font-size: 20px;
        white-space: normal;
    }

    .logo-icon {
        font-size: 22px;
    }

    .logo-section p {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .search-box button {
        min-width: 48px;
        min-height: 48px;
        padding: 0 16px;
    }

    .time-display .time {
        font-size: 26px;
    }

    .content-grid {
        gap: 16px;
    }

    .weather-card {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .location {
        font-size: 17px;
    }

    .weather-hero {
        gap: 12px;
    }

    .temp-main {
        font-size: 64px;
    }

    .weather-icon-lg {
        font-size: 52px;
    }

    .condition {
        font-size: 16px;
        margin-bottom: 18px;
    }

    .current-details {
        gap: 12px;
        padding: 0;
    }

    .detail-item {
        padding: 10px 12px;
        background: rgba(0, 25, 55, 0.45);
        border-radius: 10px;
        border: 1px solid rgba(0, 180, 255, 0.1);
    }

    .sun-times {
        gap: 10px;
        padding-top: 14px;
    }

    .footer {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
        margin-top: 20px;
    }

    .footer-copy,
    .footer-version,
    .footer-data {
        justify-self: center;
    }

    .install-panel {
        margin-top: 16px;
        padding: 16px;
    }

    .install-desc {
        font-size: 14px;
    }

    .app-actions {
        gap: 10px;
    }

    .action-btn {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 140px;
    }

    .forecast-card .forecast-wrapper {
        overflow-x: visible;
    }

    .forecast-table {
        min-width: 0;
    }

    .forecast-table thead {
        display: none;
    }

    .forecast-table tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 14px;
        background: rgba(0, 25, 55, 0.45);
        border: 1px solid rgba(0, 180, 255, 0.12);
        border-radius: 12px;
    }

    .forecast-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .forecast-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(0, 180, 255, 0.08);
        text-align: right;
    }

    .forecast-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .forecast-table td:first-child {
        padding-top: 0;
        justify-content: center;
        border-bottom: 1px solid rgba(0, 180, 255, 0.15);
        padding-bottom: 10px;
        margin-bottom: 4px;
    }

    .forecast-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--cyan-dim);
        text-align: left;
        flex-shrink: 0;
        font-size: 13px;
        letter-spacing: 0.5px;
    }

    .forecast-table td[data-label="Day"]::before {
        display: none;
    }

    .forecast-condition {
        justify-content: flex-end;
    }
}

@media (max-width: 380px) {
    .logo-section h1 {
        font-size: 17px;
    }

    .temp-main {
        font-size: 52px;
    }

    .weather-icon-lg {
        font-size: 44px;
    }

    .current-details {
        grid-template-columns: 1fr;
    }
}
