@import "https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap";

:root {
    --bg-color: #18181b;
    --card-bg: #27272a;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent-color: #ff6600;
    --accent-hover: #ffb84d;
    --border-color: #3f3f46;
    --success-color: #22c55e;
    --font-family: "Outfit", sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #4f46e5, #0000);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #c026d3, #0000);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06b6d4, #0000);
    animation-delay: -10s;
}

@keyframes float {

    0%,
    to {
        transform: translate(0);
    }

    33% {
        transform: translate(30px, -50px);
    }

    66% {
        transform: translate(-20px, 20px);
    }
}

.page-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    z-index: 1;
}

.external-header {
    text-align: center;
    position: relative;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: .5rem;
}

.header-icon {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--accent-color), #ffb84d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.external-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-color), #ffb84d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.app-container {
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px #00000080;
    border: 1px solid var(--border-color);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--accent-color);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

#locationInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
}

#locationInput::placeholder {
    color: var(--text-secondary);
}

.search-btn,
.location-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover,
.location-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.location-btn {
    width: 100%;
    justify-content: center;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading-state i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Current Weather */
.current-weather {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.05), transparent);
    border: 1px solid rgba(255, 102, 0, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.location-info h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.location-info p {
    color: var(--text-secondary);
}

.current-temp-display {
    text-align: center;
    padding: 2rem 0;
}

.temp-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.weather-icon {
    font-size: 5rem;
}

.temp-value {
    display: flex;
    align-items: flex-start;
}

#currentTemp {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
}

.temp-unit {
    font-size: 2rem;
    font-weight: 400;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.weather-description {
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    text-align: center;
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.detail-item span {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Forecast Section */
.forecast-section {
    margin-top: 2rem;
}

.forecast-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.forecast-day {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.forecast-day:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.forecast-day .day-name {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.forecast-day .forecast-icon {
    font-size: 2rem;
    margin: 0.75rem 0;
}

.forecast-day .temp-range {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.forecast-day .temp-high {
    font-weight: 600;
}

.forecast-day .temp-low {
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Back to Home Button */
.back-home-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    padding: 12px 24px;
    background: rgba(255, 102, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-home-btn:hover {
    background: rgba(255, 102, 0, 0.2);
    border-color: rgba(255, 102, 0, 0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 102, 0, 0.3);
}

.back-home-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-color);
}

/* Weather Icons */
.fa-sun {
    color: #fbbf24;
}

.fa-cloud-sun {
    color: #fb923c;
}

.fa-cloud {
    color: #94a3b8;
}

.fa-cloud-rain {
    color: #60a5fa;
}

.fa-cloud-showers-heavy {
    color: #3b82f6;
}

.fa-bolt {
    color: #eab308;
}

.fa-snowflake {
    color: #e0f2fe;
}

.fa-smog {
    color: #9ca3af;
}

/* Animations */
@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);
    }
}

.external-header {
    animation: fadeInDown 1s ease-out;
}

.app-container {
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

/* Parallax for background blobs */
.background-blobs {
    perspective: 1000px;
    overflow: hidden;
}

.blob {
    will-change: transform;
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
        padding-top: 4rem;
        width: 100%;
        overflow-x: hidden;
    }

    .back-home-btn {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        z-index: 100;
    }

    .app-container {
        padding: 1rem;
        width: 100%;
    }

    .temp-main {
        flex-direction: column;
        gap: 1rem;
    }

    #currentTemp {
        font-size: 4rem;
        line-height: 1;
    }

    .weather-icon {
        font-size: 4rem;
    }

    .forecast-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        /* Smaller min-width */
        gap: 0.5rem;
        width: 100%;
    }

    .forecast-day {
        padding: 0.75rem;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        width: 100%;
    }

    .search-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .search-bar input {
        width: 100%;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }
}