/* Resetting default styles and box-sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    line-height: 1.6;
    background-image: url('https://images.unsplash.com/photo-1534088568595-a066f410bcda?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #000000; /* Update 1: Darker body color */
}

/* Main container for layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
    width: 250px;
    background: rgba(58, 28, 113, 0.85);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

nav ul {
    list-style: none;
}

nav ul li {
    margin-bottom: 10px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Main content area styling */
main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

/* Search bar styling */
.search-bar {
    display: flex;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 25px 0 0 25px;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3498db;
}

.search-bar button {
    padding: 12px 24px;
    font-size: 16px;
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background-color: rgba(41, 128, 185, 1);
}

/* Unit toggle styling */
.unit-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.unit-toggle input {
    margin-left: 10px;
}

/* Loading spinner styling */
#loading-spinner {
    text-align: center;
    margin: 20px 0;
    display: none;
}

/* Error message styling */
.error {
    color: #e74c3c;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(250, 219, 216, 0.9);
}

/* Weather widget styling */
.weather-widget {
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.weather-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Charts container styling */
.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

/* Chart card styling */
.chart {
    flex: 1 1 calc(33.333% - 20px);
    min-width: 300px;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Tab buttons styling */
.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    font-size: 16px;
    background-color: rgba(236, 240, 241, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
    margin-right: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background-color: rgba(52, 152, 219, 0.9);
    color: #fff;
}

.tab-content {
    display: none;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    border-bottom: 2px solid rgba(236, 240, 241, 0.8);
    color: #000000; /* Update 2: Darker text color */
}

table th {
    background-color: rgba(52, 152, 219, 0.9);
    color: #fff;
}

/* Forecast table styling */
#forecastTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

#forecastTable th,
#forecastTable td {
    padding: 12px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    border-bottom: 2px solid rgba(236, 240, 241, 0.8);
    color: #000000; /* Update 2: Darker text color */
}

#forecastTable th {
    background-color: rgba(52, 152, 219, 0.9);
    color: #fff;
}

/* Pagination controls styling */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-controls button {
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination-controls button:hover {
    background-color: rgba(41, 128, 185, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#currentPage {
    margin: 0 10px;
    font-weight: bold;
}

/* Chat messages styling */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    backdrop-filter: blur(5px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #000000; /* Update 2: Darker text color */
}

/* Chat input styling */
.chat-input {
    display: flex;
    margin-top: 15px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 25px 0 0 25px;
    background-color: rgba(255, 255, 255, 0.8); /* Update 3: Increased opacity */
    transition: all 0.3s ease;
    color: #000000; /* Update 2: Darker text color */
}

.chat-input input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.8);
}

.chat-input button {
    padding: 12px 24px;
    font-size: 16px;
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-input button:hover {
    background-color: rgba(41, 128, 185, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Chatbot spacing */
#chatbot {
    margin-top: 30px;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .chart {
        flex: 1 1 100%;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        margin-bottom: 10px;
        width: 100%;
    }
}