/* Root Variables for Theme */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --warning-color: #e74c3c;
    --dark-bg: #1a1a2e;
    --dark-card: #16213e;
    --dark-text: #eaeaea;
    --light-bg: #f5f7fa;
    --light-card: #ffffff;
    --light-text: #2c3e50;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: var(--dark-bg);
    --card-color: var(--dark-card);
    --text-color: var(--dark-text);
    --border-color: #2d3561;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

body:not(.dark-mode) {
    --bg-color: var(--light-bg);
    --card-color: var(--light-card);
    --text-color: var(--light-text);
    --border-color: var(--border-color);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: white;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-title i {
    font-size: 2.8rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Theme Toggle Button */
.theme-toggle {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(20deg) scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Search Section */
.search-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.search-container {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Suggestions List */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 5px;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-sm);
}

.suggestions-list.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.suggestions-list li {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: var(--primary-color);
    color: white;
    padding-left: 20px;
}

/* Current Location Button */
.current-location button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-location button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.current-location button:active {
    transform: translateY(0);
}

/* Main Weather Section */
.main-weather {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 40px;
}

/* Current Weather Card */
.current-weather {
    background: var(--card-color);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-out;
    border-left: 5px solid var(--primary-color);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.weather-icon {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.temperature {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.weather-description {
    font-size: 1.8rem;
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 15px;
}

.location-info {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 20px;
}

.feels-like {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.loading {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.loading i {
    margin-right: 10px;
}

/* Sidebar - Weather Details */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.weather-details {
    background: var(--card-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--secondary-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item:hover {
    padding-left: 8px;
    color: var(--primary-color);
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Forecast Section */
.forecast-section,
.hourly-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-color);
}

/* Forecast Container */
.forecast-container,
.hourly-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.forecast-card {
    background: var(--card-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
    cursor: pointer;
}

.forecast-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    border-top-color: var(--secondary-color);
}

.forecast-date {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.forecast-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.forecast-temp {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.forecast-temp-range {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 10px;
}

.forecast-description {
    text-transform: capitalize;
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Hourly Card */
.hourly-card {
    background: var(--card-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary-color);
}

.hourly-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.2);
}

.hourly-time {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.hourly-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hourly-temp {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hourly-description {
    text-transform: capitalize;
    font-size: 0.85rem;
    opacity: 0.8;
}

.hourly-details {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* Error Message */
.error-message {
    background: var(--warning-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.error-message.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-weather {
        grid-template-columns: 1fr;
    }

    .forecast-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .app-title {
        font-size: 2rem;
    }

    .temperature {
        font-size: 3rem;
    }

    .weather-icon {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0 15px;
    }

    .app-title {
        font-size: 1.8rem;
    }

    .search-section {
        flex-direction: column;
    }

    .search-container {
        min-width: 100%;
    }

    .current-location button {
        width: 100%;
        justify-content: center;
    }

    .current-weather {
        padding: 30px 20px;
    }

    .temperature {
        font-size: 2.5rem;
    }

    .weather-icon {
        font-size: 4rem;
    }

    .weather-description {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .forecast-container,
    .hourly-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .forecast-card {
        padding: 15px;
    }

    .forecast-icon {
        font-size: 2.5rem;
    }

    .forecast-date {
        font-size: 0.95rem;
    }

    .forecast-temp {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.4rem;
        gap: 8px;
    }

    .app-title i {
        font-size: 1.8rem;
    }

    .header {
        margin-bottom: 20px;
    }

    .current-weather {
        padding: 20px;
        text-align: center;
    }

    .temperature {
        font-size: 2rem;
    }

    .weather-icon {
        font-size: 3rem;
    }

    .weather-description {
        font-size: 1.1rem;
    }

    .forecast-container,
    .hourly-container {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .detail-item {
        padding: 10px 0;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
