/* ==========================================================================
   MAILE KABARI DESIGN SYSTEM
   Vibrant Eco-Green & Deep Slate Premium Dark Aesthetic
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Tokens - Slate Dark Theme */
    --bg-primary: #080c14;
    --bg-secondary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.45);
    --bg-card-hover: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(16, 185, 129, 0.3);
    
    /* Eco-Green Accents */
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);
    
    /* Semantic Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Layout Constants */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glassmorphism */
    --glass-blur: 12px;
    --glass-background: rgba(15, 23, 42, 0.65);
}

/* Light Theme overrides (Optional / Future expansion, default is dark) */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(16, 185, 129, 0.4);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --glass-background: rgba(255, 255, 255, 0.75);
    --glass-blur: 16px;
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.05);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Common Layout Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphic Panel Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 12px 16px;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    background: rgba(15, 23, 42, 0.85);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    outline: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #000000;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    color: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

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

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-assigned {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-collected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Navigation Header */
.app-header {
    background: rgba(8, 12, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a.active, .nav-links a:hover {
    color: var(--text-primary);
}

/* Footer Section */
.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Auth Pages Styling (Tabs) */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-content-panel {
    display: none;
}

.auth-content-panel.active {
    display: block;
}

/* Customer / Staff Mobile Dashboard elements */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid-full {
        grid-column: span 2;
    }
}

/* Scrollable scrap rates carousel */
.rates-feed {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
}

.rates-feed::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.rate-card {
    flex: 0 0 110px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    scroll-snap-align: start;
    transition: var(--transition-fast);
}

.rate-card:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.rate-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.rate-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rate-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

/* Order Cards */
.order-list-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition-fast);
}

.order-list-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-id {
    font-weight: 700;
    font-size: 0.95rem;
}

.order-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
}

.order-payout {
    font-weight: 700;
    color: var(--primary);
}

/* Leaflet Map Styling Override */
.leaflet-container {
    width: 100%;
    height: 250px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    z-index: 1;
}

/* Multi-step request wizard */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    transition: var(--transition-normal);
}

.step-dot.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.step-dot.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: #000000;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Scrap items weight inputs grid */
.scrap-input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.scrap-input-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}

.scrap-input-item.selected {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.scrap-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    accent-color: var(--primary);
}

.scrap-input-fields {
    display: none;
    margin-top: 10px;
}

.scrap-input-item.selected .scrap-input-fields {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Notification banner */
.notifications-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
    background: rgba(16, 185, 129, 0.03);
}

.notification-item:last-child {
    border-bottom: none;
}

/* Admin Dashboard Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Action Modal / Drawer */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

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

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Slider button for staff collection */
.slider-container {
    position: relative;
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

.slider-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

.slider-button {
    position: absolute;
    left: 3px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 2;
    transition: left 0.1s ease-out;
}

.slider-button:active {
    cursor: grabbing;
}

.slider-button::after {
    content: '→';
    font-size: 1.4rem;
    font-weight: 800;
    color: #000000;
}
