/* Dashboard Styles */
:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f9fafb;
    color: #1f2937;
}

/* ========== Sidebar ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: white;
}

.nav-item i {
    font-size: 1.25rem;
    width: 20px;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== Main Content ========== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--header-height) 0 0;
}

/* ========== Header ========== */
.dashboard-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 900;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1f2937;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    min-width: 250px;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
}

.notifications {
    position: relative;
    cursor: pointer;
    font-size: 1.25rem;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

/* ========== Sections ========== */
.section {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #6b7280;
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.carbon .stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-card.energy .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.stat-card.plastic .stat-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.stat-card.goal .stat-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-trend {
    font-size: 0.875rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.positive {
    color: #10b981;
}

.stat-trend.negative {
    color: #ef4444;
}

/* ========== Charts ========== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.chart-header h3 {
    font-size: 1.25rem;
}

.chart-card canvas {
    max-height: 300px;
}

/* ========== Cards ========== */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

/* ========== Forms ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ========== Buttons ========== */
.btn-primary, .btn-secondary, .btn-icon {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: #6b7280;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #ef4444;
}

/* ========== Table ========== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-weight: 600;
    color: #374151;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge.transportation { background: #dbeafe; color: #1e40af; }
.badge.energy { background: #fef3c7; color: #92400e; }
.badge.food { background: #d1fae5; color: #065f46; }
.badge.waste { background: #e9d5ff; color: #6b21a8; }
.badge.water { background: #cffafe; color: #155e75; }

/* ========== Tips Grid ========== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
}

.tip-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tip-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.tip-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.impact-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.impact-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.impact-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.impact-badge.low {
    background: #dbeafe;
    color: #1e40af;
}

/* ========== Waste Categories ========== */
.waste-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.category-item {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.category-item.recyclable { background: #d1fae5; color: #065f46; }
.category-item.biodegradable { background: #d1fae5; color: #065f46; }
.category-item.hazardous { background: #fee2e2; color: #991b1b; }
.category-item.landfill { background: #f3f4f6; color: #374151; }

.category-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.waste-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
}

/* ========== Notification Panel ========== */
.notification-panel {
    position: fixed;
    right: -400px;
    top: 0;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

.notification-panel.open {
    right: 0;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-panel {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.notification-item {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    transition: background 0.3s ease;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #ecfdf5;
}

.notif-icon {
    font-size: 1.5rem;
}

.notif-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.notif-content p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notif-content small {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* ========== Toast Notifications ========== */
.toast {
    position: fixed;
    top: 90px;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast i {
    font-size: 1.25rem;
}

.toast-success i {
    color: #10b981;
}

.toast-error i {
    color: #ef4444;
}

/* ========== Utilities ========== */
.text-center {
    text-align: center;
}

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

/* ========== Responsive ========== */
@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-header {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .search-bar {
        display: none;
    }

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

    .notification-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 640px) {
    .header-right {
        gap: 0.75rem;
    }

    .user-profile span {
        display: none;
    }

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

    .section {
        padding: 1rem;
    }
}
