/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #2ecc71;
    --secondary-green: #27ae60;
    --accent-green: #1abc9c;
    --dark-green: #16a085;
    --light-green: #a8e6cf;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-green) 0%, var(--accent-green) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* ===== Authentication Page Styles ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    max-width: 500px;
    width: 100%;
    padding: 40px;
    animation: fadeInUp 0.6s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 42px;
    color: var(--primary-green);
}

.logo h1 {
    font-size: 36px;
    color: var(--secondary-green);
    font-weight: 700;
}

.tagline {
    color: var(--text-light);
    font-size: 14px;
}

.auth-form h2 {
    color: var(--text-dark);
    margin-bottom: 25px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary-green);
    font-size: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background: var(--accent-green);
    color: white;
}

.btn-secondary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.form-switch a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

.form-switch a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-light);
    font-size: 12px;
}

/* ===== Dashboard Layout ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--secondary-green) 0%, var(--dark-green) 100%);
    color: white;
    padding: 30px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px var(--shadow);
}

.sidebar-header {
    padding: 0 30px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.sidebar-logo i {
    font-size: 32px;
}

.sidebar-logo h2 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.user-details h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.user-details p {
    font-size: 12px;
    opacity: 0.8;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid var(--light-green);
    padding-left: 26px;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
}

.logout-btn {
    margin: 20px 30px 0;
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid var(--danger);
}

.logout-btn:hover {
    background: var(--danger);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    background: var(--bg-light);
}

.content-header {
    background: white;
    padding: 25px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow);
}

.content-header h1 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.content-header p {
    color: var(--text-light);
    font-size: 14px;
}

.content-body {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px var(--shadow);
}

/* ===== Cards & Statistics ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-hover);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stat-icon.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== Table Styles ===== */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

thead {
    background: var(--bg-light);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tr:hover {
    background: var(--bg-light);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.status-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-done {
    background: #d1e7dd;
    color: #0f5132;
}

/* ===== Buttons Group ===== */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 13px;
    width: auto;
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ===== Camera Capture ===== */
.camera-container {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

#videoElement {
    width: 100%;
    height: auto;
    display: block;
}

#capturedImage {
    width: 100%;
    height: auto;
    display: none;
    border-radius: 15px;
}

.camera-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ai-result {
    background: linear-gradient(135deg, var(--light-green), var(--accent-green));
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    display: none;
}

.ai-result h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-result .waste-type {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-green);
    margin-bottom: 10px;
}

.ai-result .confidence {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== Map Container ===== */
.map-container {
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 2px 10px var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
}

/* ===== Rewards Section ===== */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.reward-card {
    background: white;
    border: 2px solid var(--light-green);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-hover);
    border-color: var(--primary-green);
}

.reward-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.reward-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.reward-info h3 {
    color: var(--text-dark);
    margin-bottom: 5px;
}

.reward-points {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 14px;
}

.reward-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

/* ===== Points Display ===== */
.points-display {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.3);
}

.points-display h2 {
    font-size: 48px;
    margin-bottom: 10px;
}

.points-display p {
    font-size: 18px;
    opacity: 0.9;
}

/* ===== Charts ===== */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 20px;
}

.chart-container canvas {
    max-height: 400px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: all 0.3s ease;
    }

    .sidebar.active {
        width: 280px;
        transform: translateX(0);
    }

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

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

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

    .content-header h1 {
        font-size: 22px;
    }

    .auth-container {
        padding: 30px 20px;
    }
}

/* ===== Loading Spinner ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Alert Messages ===== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-info {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    font-size: 14px;
}
