/**
 * Food Pantry Management System - Main Stylesheet
 * 
 * Custom styles for the application
 */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --border-radius: 0.5rem;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --transition: all 0.2s ease-in-out;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Custom Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Navigation Enhancements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, var(--bg-white) 0%, #f1f5f9 100%);
    border-left: 4px solid var(--primary-color);
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Stats Cards */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-white);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.stats-card .stats-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stats-card .stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Tables */
.table {
    background-color: var(--bg-white);
}

.table thead th {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: var(--border-radius);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: var(--success-color);
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left-color: var(--warning-color);
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: var(--danger-color);
}

.alert-info {
    background-color: #f0f9ff;
    color: #075985;
    border-left-color: var(--info-color);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 5;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.quick-action {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
    color: var(--primary-color);
    text-decoration: none;
}

.quick-action .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.quick-action .title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quick-action .description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Client Cards */
.client-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.client-card .client-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.client-card .client-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.client-card .client-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.client-card .stat {
    text-align: center;
}

.client-card .stat-number {
    font-weight: 600;
    color: var(--primary-color);
}

.client-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Visit Timeline */
.visit-timeline {
    position: relative;
    padding-left: 2rem;
}

.visit-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.visit-item {
    position: relative;
    margin-bottom: 2rem;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.visit-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-white);
    box-shadow: 0 0 0 3px var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action {
        min-width: auto;
    }
    
    .dashboard-card h3 {
        font-size: 2rem;
    }
    
    .stats-card .stats-number {
        font-size: 2rem;
    }
    
    .client-card .client-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #0f172a;
        --bg-white: #1e293b;
        --text-dark: #f1f5f9;
        --text-muted: #94a3b8;
        --border-color: #334155;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .quick-actions,
    footer {
        display: none !important;
    }
    
    .container-fluid {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
    }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
