:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #f43f5e;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --sidebar-background: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --accent-color: #f43f5e;
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --background-color: #111827;
    --card-background: #1f2937;
    --sidebar-background: #1f2937;
}

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

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

.app-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--sidebar-background);
    padding: 2rem;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
    position: fixed;
    width: 300px;
}

.sidebar-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.sidebar-header h1 span {
    color: var(--accent-color);
}

.search-container {
    margin-bottom: 1rem;
    width: 100%;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background-color: transparent;
    color: var(--text-color);
    transition: var(--transition);
    min-width: 0;
}

input[type="text"]:focus {
    outline: none;
}

#search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    min-width: 45px;
    height: 45px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#search-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#search-btn i {
    font-size: 1rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 8px 0;
    border: none;
    background: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.nav-item i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background-color: var(--hover-color);
    transform: translateX(5px);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.nav-item.active:hover {
    background-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.nav-item.active i {
    transform: scale(1.1);
}

.theme-toggle {
    margin-top: auto;
}

.theme-toggle button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle button:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

/* Main Content Styles */
.main-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-left: 300px;
    width: calc(100vw - 300px);
}

.current-weather {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0 auto;
}

.weather-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.metric-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -1px rgba(0, 0, 0, 0.1);
}

.metric-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
}

.metric-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.metric-info p {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.forecast-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.forecast-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.forecast-date {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.forecast-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Responsive Design */
@media (max-width: 1200px) {
    .weather-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

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

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 1rem;
    }
}

/* Map Styles */
.map-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    height: calc(100vh - 100px);
    margin: 0;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
}

.map-popup {
    text-align: center;
    padding: 0.5rem;
}

.map-popup h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.map-popup .temp {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.map-popup .description {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.map-popup .details {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Forecast Page Styles */
.forecast-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.current-location {
    text-align: center;
    margin-bottom: 2rem;
}

.current-location h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.current-date {
    color: var(--text-light);
}

.hourly-forecast,
.daily-forecast {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.hourly-forecast h3,
.daily-forecast h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.hourly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.hourly-card {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.hourly-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.hourly-card .hour {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.hourly-card .temp {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.hourly-card .description {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.daily-card {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.daily-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.daily-card .day {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.daily-card .temp-range {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.daily-card .max {
    color: var(--text-color);
    font-weight: 600;
}

.daily-card .min {
    color: var(--text-light);
}

.daily-card .description {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* History Page Styles */
.history-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.history-item:hover {
    transform: translateX(5px);
}

.history-info h3 {
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.history-info .timestamp {
    color: var(--text-light);
    font-size: 0.9rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-actions button {
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: none;
}

.search-again {
    color: var(--primary-color);
}

.search-again:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.delete-item {
    color: var(--accent-color);
}

.delete-item:hover {
    background-color: rgba(244, 63, 94, 0.1);
}

.no-history {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}