/* Modern UI Design System for Smart Waste Management */

:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
}

/* ===== NAVBAR ===== */
.navbar-modern {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
    border-bottom: none;
}

.navbar-modern .navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.navbar-modern .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.navbar-modern .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.navbar-modern .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.2);
}

.navbar-modern .btn-nav-cta {
    background: rgba(255,255,255,0.2);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.navbar-modern .btn-nav-cta:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.navbar-modern .navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.navbar-modern .navbar-toggler-icon {
    filter: invert(1);
}

/* User badge in navbar */
.navbar-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-xl) !important;
    border: none !important;
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl) !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-card .stat-sub {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 0.25rem;
    position: relative;
    z-index: 1;
}

/* Stat card color variants */
.stat-card-primary { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.stat-card-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card-danger  { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.stat-card-info    { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.stat-card-teal    { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); }

/* ===== TABLES ===== */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.table-modern thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table-modern tbody tr {
    transition: background 0.15s ease;
}

.table-modern tbody tr:hover {
    background: var(--gray-50);
}

.table-modern tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--gray-700);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-secondary{ background: #f3f4f6; color: #374151; }
.badge-purple   { background: #ede9fe; color: #5b21b6; }

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-icon-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

/* ===== ADMIN SIDEBAR ===== */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    color: white;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    flex-shrink: 0;
}

.sidebar-brand-text h5 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand-text small {
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    font-weight: 400;
}

.sidebar-section-label {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0.75rem;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: 0.125rem;
}

.sidebar-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.625rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.5), rgba(139,92,246,0.4));
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.sidebar-nav a.active i {
    opacity: 1;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.75rem 1.25rem;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Admin Main Content */
.admin-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--gray-50);
}

.admin-topbar {
    background: #fff;
    padding: 0.875rem 1.75rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.admin-topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.page-content {
    flex: 1;
    padding: 1.75rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
    padding: 2rem 1rem;
}

.auth-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}

.auth-logo h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.auth-logo p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ===== HOME PAGE ===== */
.hero-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: #fff;
    color: var(--primary-dark);
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    color: var(--primary-dark);
}

.btn-hero-secondary {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: translateY(-2px);
}

.feature-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--gray-200);
    transition: all 0.25s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}

.feature-icon-primary { background: #ede9fe; }
.feature-icon-success { background: #d1fae5; }
.feature-icon-info    { background: #dbeafe; }
.feature-icon-warning { background: #fef3c7; }

.feature-card h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.6;
}

/* ===== FILL LEVEL BAR ===== */
.fill-bar-wrap {
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
    min-width: 80px;
}

.fill-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.fill-bar-low    { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-bar-medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-bar-high   { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: #dbeafe; color: #1e40af; }

/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--gray-900);
    color: #fff;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 360px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

/* ===== FOOTER ===== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    margin-top: auto;
}

.site-footer p {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 0;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-main {
        margin-left: 0;
    }

    .page-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }
}

/* ===== SCROLLBAR ===== */
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ===== UTILITY ===== */
.text-muted { color: var(--gray-500) !important; }
.fw-600 { font-weight: 600; }
.gap-2 { gap: 0.5rem; }

/* Animate.css compatibility */
.animate__animated { --animate-duration: 500ms; }
