/* ============================================================
   FoodShare Rescue - Premium NGO Design System
   ============================================================ */

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #dcfce7;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --accent-light: #fff7ed;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

/* Glassmorphism */
.navbar-glass {
    background: rgba(255,255,255,0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.dark .navbar-glass { background: rgba(15,23,42,0.85) !important; }

/* Buttons */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    transition: all var(--transition);
}
.btn-ghost:hover { color: var(--text); background: var(--border); border-radius: var(--radius-sm); }

.btn-success { background: var(--primary); border-color: var(--primary); }
.btn-success:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-orange { background: var(--accent); border-color: var(--accent); color: white; }
.btn-orange:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }

/* Avatar */
.avatar-sm { width: 36px; height: 36px; object-fit: cover; }
.avatar-md { width: 48px; height: 48px; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; object-fit: cover; }

/* Sidebar */
.sidebar {
    width: 260px;
    height: calc(100vh - 60px);
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed { width: 0; overflow: hidden; border: none; left: -260px; }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.dark .sidebar-link:hover, .dark .sidebar-link.active {
    background: rgba(22,163,74,0.15);
}
.sidebar-link i { width: 20px; text-align: center; }

.main-content {
    flex: 1;
    padding: 1.5rem;
    min-height: calc(100vh - 60px);
    transition: all 0.3s ease;
    overflow-x: hidden;
    margin-left: 260px;
}
.main-content.expanded { margin-left: 0; }

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface);
    transition: all var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.stat-card .stat-trend {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Status Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--surface);
}
.timeline-item.completed::before { background: var(--primary); }
.timeline-item.active::before { background: var(--accent); }
.timeline-item:last-child { padding-bottom: 0; }

/* Notification Dropdown */
.notification-dropdown { width: 360px; max-width: 90vw; border-radius: var(--radius-lg); }
.notif-item:hover { background: var(--bg); }
.notif-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }

.bg-info-subtle { background: #dbeafe; }
.bg-success-subtle { background: #dcfce7; }
.bg-warning-subtle { background: #fef3c7; }
.bg-danger-subtle { background: #fee2e2; }
.bg-primary-subtle { background: #ede9fe; }
.dark .bg-info-subtle { background: rgba(59,130,246,0.2); }
.dark .bg-success-subtle { background: rgba(34,197,94,0.2); }
.dark .bg-warning-subtle { background: rgba(245,158,11,0.2); }
.dark .bg-danger-subtle { background: rgba(239,68,68,0.2); }
.dark .bg-primary-subtle { background: rgba(99,102,241,0.2); }

.text-info { color: #3b82f6 !important; }
.text-success { color: #22c55e !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }
.text-orange { color: var(--accent) !important; }

.bg-orange { background: var(--accent) !important; }
.bg-orange-subtle { background: var(--accent-light); }

/* DataTables styling */
.dataTables_wrapper .dt-buttons { margin-bottom: 0.5rem; }
.dataTables_filter input {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    padding: 0.375rem 0.75rem !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}
.dataTables_length select {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

/* Table styling */
.table { color: var(--text); }
.table > thead { background: var(--bg); }
.dark .table > thead { background: rgba(0,0,0,0.2); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state i { font-size: 4rem; color: var(--border); margin-bottom: 1rem; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, transparent 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Form controls */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.625rem 0.875rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.dark .form-control, .dark .form-select { background: #1e293b; }

/* Badge */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* Modal */
.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 30%, #fff7ed 70%, #ffedd5 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.dark .hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1a2e1a 50%, #2d1a0a 100%);
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(22,163,74,0.1) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    border-radius: 50%;
}

/* Step Cards */
.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
}
.dark .step-number { background: rgba(22,163,74,0.2); }

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Counter animation */
.counter-value { transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}
.dark .glass-card {
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Modern Search */
.search-wrapper {
    position: relative;
    width: 320px;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
    background: var(--bg);
}
.search-icon {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-right: 0.5rem;
}
.search-input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.25rem 0;
    min-width: 0;
}
.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.75;
}
.search-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s;
}
.search-clear:hover {
    color: var(--text);
    background: var(--border);
}
.search-spinner {
    margin-left: 0.5rem;
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
}
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}
.search-item:last-child {
    border-bottom: none;
}
.search-item:hover {
    background: var(--bg);
}
.search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.search-item-content {
    flex: 1;
    min-width: 0;
}
.search-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-item-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-item-badge {
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    border-radius: 0.3rem;
    text-transform: capitalize;
    flex-shrink: 0;
}
.search-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}
.search-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; z-index: 1000; width: 260px; }
    .sidebar.collapsed { left: -260px; width: 260px; }
    .search-wrapper { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .hero-section { padding: 3rem 0; }
}
@media (max-width: 991px) {
    .search-wrapper { width: 220px; }
    .search-box { padding: 0.3rem 0.6rem; }
}
