@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --primary: #5b51d8;
    --primary-dark: #4a42b8;
    --bg-main: #e8eaf0;
    --card-bg: #ffffff;
    --text-dark: #1a1a2e;
    --text-gray: #6b7280;
    --border: #d1d5db;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}

.logo-svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 60vh;
}

/* Dashboard Centered Layout */
.dashboard-wrapper {
    width: 100%;
}

.search-container-centered {
    max-width: 600px;
    margin: 0 auto 2rem;
    width: 100%;
}

.results-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.weather-results-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.details-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Unified Search Box */
.search-box {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--primary-dark);
}

.search-box svg {
    width: 20px;
    height: 20px;
}

/* Loader Centered */
.loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
}

.loader.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(91, 81, 216, 0.1);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-msg {
    display: none;
    background: #fee2e2;
    color: #b91c1c;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
}

.error-msg.active {
    display: block;
}

/* Weather Info Container */
.weather-info-container {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.weather-info-container.active {
    display: flex;
    animation: slideUp 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Weather Card Details */
.weather-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.weather-main img {
    width: 120px;
    height: 120px;
}

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

.temp-display h1 {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
}

.temp-display span {
    font-size: 2rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
}

.detail-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9fafb;
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.detail-card svg {
    width: 44px;
    height: 44px;
    color: var(--text-dark);
}

.detail-card .value {
    font-size: 1.6rem;
    font-weight: 700;
}

.detail-card .label {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* Forecast */
.forecast-card {
    grid-column: 1 / -1;
    display: none;
}

.forecast-card.active {
    display: block;
}

.forecast-scroll {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.forecast-item {
    min-width: 130px;
    text-align: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: 0.3s;
}

.forecast-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.forecast-item .time {
    font-weight: 700;
}

.forecast-item .temp {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

/* Generic Page Styles */
.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-gray);
    max-width: 700px;
    margin: 0 auto;
}

/* About Page Specifics */
.about-page {
    max-width: 1000px;
    margin: 0 auto;
}

.mission-card {
    border-left: 6px solid var(--primary);
    margin-bottom: 4rem;
}

.mission-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 2.5rem;
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(91, 81, 216, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-card p {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.7;
}

.technology-card {
    text-align: center;
    padding: 3rem;
}

.technology-card h2 {
    margin-bottom: 2rem;
}

.tech-stack {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tech-item {
    background: var(--bg-main);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Forecast Grid for Extended Page */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 3rem 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-gray);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--primary);
}

/* Mobile Support */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow);
    }

    .weather-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .temp-display h1 {
        font-size: 3.5rem;
    }

    .search-container-centered {
        max-width: 100%;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }
}