* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #7e57c2;
    --secondary-color: #f87171;
    --background-color: #f0f2f5;
    --sidebar-width: 280px;
    --card-background: white;
    --text-color: #333;
    --transition-speed: 0.3s;
    --card-gap: 1rem;
    --card-padding: 1.25rem;
    --chart-blue: #bae6fd;
    --chart-purple: #7e57c2;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
}

.container {
    display: flex;
    width: 100%;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none; /* Hide on desktop */
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: #1f2937;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: all var(--transition-speed) ease;
    padding: 0;
    margin: 0;
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1002; /* Above the sidebar */
}

/* Removed the non-working CSS rule for sidebar.show ~ .hamburger-menu */

.hamburger-menu::after {
    content: '>';
    color: white;
    transition: transform 0.3s ease;
}

/* Remove dashboard arrow when sidebar is shown */
.sidebar.show .menu a[href="#dashboard"]::after {
    display: none;
}

/* Overlay for when sidebar is visible */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

body.sidebar-open::before {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-background);
    padding: var(--card-padding);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    height: 100vh;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    top: 0;
    left: 0;
    /* Remove transform property */
}

.sidebar.show {
    transform: translateX(0);
}

.logo {
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo span {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

.user-profile {
    text-align: center;
    padding: 0.5rem 0;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.user-profile h3 {
    font-size: 1rem;
    font-weight: 600;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu a, .logout {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.menu a:hover, .logout:hover {
    background-color: #f5f5f5;
}

.menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.menu a[href="#dashboard"] {
    display: flex;
    justify-content: space-between;
}

.menu a[href="#dashboard"]::after {
    content: '>';
    font-size: 14px;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar.show .menu a[href="#dashboard"]::after {
    transform: rotate(180deg);
}

.icon {
    font-size: 1.2rem;
}

/* Notification badge for menu */
.menu a .icon {
    position: relative;
    margin-right: 10px;
}

.menu a .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--card-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--card-gap);
    width: calc(100% - var(--sidebar-width));
    /* Remove transition property */
}

/* Remove the margin adjustment for main content when sidebar is shown */
.sidebar.show + .main-content {
    margin-left: 0;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

select#timeRange {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
    outline: none;
}

.updates-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.updates-btn:hover {
    transform: translateY(-2px);
}

/* Cost Section Styles */
.cost-section {
    background-color: var(--card-background);
    padding: var(--card-padding);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

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

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Bar Chart Styles */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0;
}

.bar {
    flex: 1;
    min-width: 30px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.bar:hover {
    opacity: 0.8;
}

.bar-top, .bar-bottom {
    position: absolute;
    width: 100%;
    left: 0;
}

.bar-top {
    background: #e0f2fe;
    top: 0;
    border-radius: 8px 8px 0 0;
}

.bar-bottom {
    background: #c7d2fe;
    bottom: 0;
    border-radius: 0 0 8px 8px;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #64748b;
}

/* Legend Styles */
.legend {
    display: flex;
    gap: 1rem;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend .gas::before {
    background: linear-gradient(to right, #93c5fd, #60a5fa);
}

.legend .electricity::before {
    background: linear-gradient(to right, #818cf8, #6366f1);
}

.chart-container {
    flex: 1;
    position: relative;
}

/* Bottom Grid Styles */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--card-gap);
    margin-bottom: var(--card-gap);
}

.bottom-grid section {
    background-color: var(--card-background);
    padding: var(--card-padding);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Active Appliances Styles */
.appliance-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.appliance-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.appliance-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.appliance-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, #7e57c2, #10b981);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.appliance-item:hover::before {
    opacity: 1;
}

.appliance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.appliance-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.appliance-name::before {
    content: '⚡';
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.status-indicator:hover::after {
    transform: translateX(100%);
}

.status-indicator.status-active {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-indicator.status-inactive {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-indicator:hover {
    transform: scale(1.2);
}

.status-indicator:active {
    transform: scale(0.9);
}

.appliance-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-bar {
    height: 5px;
    background-color: #e5e7eb;
    border-radius: 2.5px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.progress-bar:hover::after {
    transform: translateX(100%);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #7e57c2, #10b981);
    border-radius: 2.5px;
    transition: width 0.3s ease;
}

.appliance-usage {
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.appliance-usage::before {
    content: '📊';
    font-size: 0.8rem;
}

/* Usage Estimate Styles */
.usage-estimate .current-usage {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #64748b;
}

/* Predictions Styles */
.prediction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

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

.prediction-card h3 {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-weight: 500;
}

.prediction-card .amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Update legend styles */
.legend {
    display: flex;
    gap: 1rem;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend .gas::before {
    background: linear-gradient(to right, #93c5fd, #60a5fa);
}

.legend .electricity::before {
    background: linear-gradient(to right, #818cf8, #6366f1);
}

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

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Keep only mobile-specific responsiveness */
@media (max-width: 768px) {
    /* We'll implement this later */
    /* For now, keeping the structure but not making it actually respond */
    .bottom-grid {
        grid-template-columns: repeat(3, 1fr); /* Keep 3 columns on mobile too for now */
    }
    
    .cost-section {
        min-height: 350px; /* Keep the same height as desktop */
    }
    
    .chart-container {
        min-height: 150px;
    }
    
    .bottom-grid section {
        min-height: 200px; /* Keep the same height as desktop */
    }

    .main-content {
        padding: var(--card-padding); /* Keep the same padding */
    }

    header {
        flex-direction: row; /* Keep horizontal layout */
        gap: 1rem;
        align-items: center;
    }

    .header-right {
        flex-direction: row; /* Keep horizontal layout */
    }

    select#timeRange, .updates-btn {
        width: auto; /* Don't make them full width */
    }
}

/* Weather Prediction Styles */
.weather-prediction {
    background-color: var(--card-background);
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}

.weather-prediction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #7e57c2, #10b981);
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.weather-info::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: 50%;
    transform: translate(20px, -20px);
}

.weather-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-radius: 50%;
    color: white;
    position: relative;
    overflow: hidden;
}

.weather-icon::before {
    content: '🌧️';
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.weather-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.weather-icon:hover::after {
    transform: translateX(100%);
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    position: relative;
    z-index: 1;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(96, 165, 250, 0.2);
}

.weather-condition {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

.weather-temp {
    font-size: 0.8rem;
    color: #64748b;
}

.prediction-advice {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.prediction-advice:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.prediction-advice::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, #7e57c2, #10b981);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.prediction-advice:hover::before {
    opacity: 1;
}

.prediction-advice p {
    font-size: 0.8rem;
    color: #166534;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.prediction-advice p::before {
    content: '💡';
    font-size: 0.9rem;
}

/* Prediction Section Styles */
.prediction {
    background-color: var(--card-background);
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}

.prediction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #7e57c2, #10b981);
}

.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-recommendation {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
}

.ai-recommendation::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: 50%;
    transform: translate(20px, -20px);
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.recommendation-header i {
    color: #f59e0b;
    font-size: 1rem;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.recommendation-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    gap: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.recommendation-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.recommendation-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, #7e57c2, #10b981);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.recommendation-item:hover::before {
    opacity: 1;
}

.recommendation-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.recommendation-text p {
    font-size: 0.75rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
}

.savings {
    font-size: 0.7rem;
    color: #10b981;
    font-weight: 500;
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.savings::before {
    content: '💡';
    font-size: 0.8rem;
}

.apply-btn {
    background-color: #f0fdf4;
    color: #10b981;
    border: 1px solid #86efac;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.apply-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.apply-btn:hover {
    background-color: #dcfce7;
    transform: translateY(-1px);
}

.apply-btn:hover::after {
    transform: translateX(100%);
}

.prediction .chart-container {
    height: 100px;
    margin-top: 0.25rem;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background-color: rgba(0, 0, 0, 0.02);
}

.profile-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateX(2px);
}

.profile-link .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #7e57c2;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-link:hover .avatar {
    transform: scale(1.05);
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-link h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    transition: all 0.2s ease;
}

.profile-link:hover h3 {
    color: #7e57c2;
}

/* Logout button styling */
.menu .logout-btn {
    margin-top: auto;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.menu .logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateX(5px);
}