body {
    background-color: #f8f9fa;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    scrollbar-gutter: stable;
    /* Prevent layout shift when scrollbar appears */
    width: 100%;
}

#content-area {
    overflow-x: hidden;
    /* Ensure content doesn't overflow horizontally */
    width: 100%;
    position: relative;
}

.card {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 1rem;
}

/* Bottom Navigation - Enhanced */
.navbar.fixed-bottom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    /* Remove default padding */
    padding-bottom: env(safe-area-inset-bottom);
    /* Only safe area */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    height: 60px;
    /* Fixed height + safe area */
    box-sizing: content-box;
}

/* FAB Button */
.fab-btn {
    position: fixed;
    bottom: 90px;
    /* Above navbar (60px + padding) */
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.4);
    z-index: 1050;
    /* Higher than navbar (1030 usually) */
    transition: transform 0.2s ease;
}

.navbar .container-fluid {
    height: 100%;
    padding: 0;
    display: flex;
    /* Ensure flexbox */
    justify-content: space-around;
    /* Distribute space */
}

.nav-link {
    color: #6c757d;
    transition: color 0.3s ease;
    padding: 0;
    border-radius: 0;
    position: relative;
    height: 100%;
    flex: 1;
    /* Share width equally */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    /* Remove hover background */
    max-width: 25%;
    /* Prevent any single link from taking over */
}

.nav-link:hover {
    color: #0d6efd;
    transform: none;
    /* Remove lift effect to prevent jitter */
}

.nav-link.active {
    color: #0d6efd;
    font-weight: normal;
    /* Prevent font weight shift */
}

/* Active Indicator - Moved to Bottom */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    /* Move to bottom */
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 3px 3px 0 0;
    /* Rounded top corners */
    animation: slideUp 0.3s ease-out;
}

.nav-link i {
    display: block;
    margin-bottom: 2px;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    height: 24px;
    /* Fixed height for icon */
    line-height: 24px;
}

.nav-link.active i {
    transform: scale(1.1);
}

.nav-link .small {
    font-size: 0.7rem;
    /* Constant font size */
    line-height: 1;
    height: 12px;
    /* Fixed height for text */
    display: block;
}

.nav-link.active .small {
    font-size: 0.7rem;
    /* Keep same size */
    font-weight: 600;
    /* Use weight instead of size for emphasis */
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Slide transition for tab content */
.tab-content {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Adjust content area for bottom nav */
#content-area {
    padding-bottom: 80px;
}

/* Remove top padding/margin for stats tab */
#tab-stats {
    margin-top: 0;
}

#tab-stats #statistics {
    margin-top: 0;
}

/* Accordion Overrides */
.accordion-button:not(.collapsed) {
    color: var(--bs-accordion-btn-color);
    background-color: var(--bs-accordion-btn-bg);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .125);
}

/* Filter Button */
.btn-filter {
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    border: none;
    background: transparent;
}

.btn-filter:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
}

/* Charts Removed */

/* Smart Stats UI */
.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #a05cc9 100%);
}

#eom-card {
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2);
}

#insights-stream .alert {
    border: none;
    border-left: 4px solid;
}

#insights-stream .alert-danger {
    border-left-color: #dc3545;
    background-color: #fff5f5;
    color: #842029;
}

#insights-stream .alert-warning {
    border-left-color: #ffc107;
    background-color: #fffbf0;
    color: #664d03;
}

#insights-stream .alert-success {
    border-left-color: #198754;
    background-color: #f0fff4;
    color: #0f5132;
}

#insights-stream .alert-info {
    border-left-color: #0dcaf0;
    background-color: #f0faff;
    color: #055160;
}

/* Toast Notifications */
.toast {
    min-width: 250px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast.bg-success {
    background-color: #198754 !important;
    color: white;
}

.toast.bg-danger {
    background-color: #dc3545 !important;
    color: white;
}

.toast.bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

.toast.bg-info {
    background-color: #0dcaf0 !important;
    color: #000;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h6 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Skeleton Loader for Charts */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

.skeleton-chart {
    width: 100%;
    height: 300px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Smooth chart fade-in */
canvas {
    animation: chartFadeIn 0.5s ease-in-out;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}