/**
 * Fertilizer and Pesticide Authority
 * Layout, Header, Sidebar & Scroll-to-Top Styles
 * Separated from Blade layouts for CSP compliance & clean structure
 */

/* Floating Blurred Scroll-to-Top Button */
.scroll-to-top-btn {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 9999 !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 9999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    backdrop-filter: blur(14px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
    background: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    color: #0f2744 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(14px) !important;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 15px !important;
}

.scroll-to-top-btn.is-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.scroll-to-top-btn:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #059669 !important;
    transform: translateY(-2px) scale(1.08) !important;
    box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.35) !important;
}

/* Dark Theme adaptation */
html.dark .scroll-to-top-btn {
    background: rgba(15, 39, 68, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

html.dark .scroll-to-top-btn:hover {
    background: rgba(15, 39, 68, 0.95) !important;
    color: #34d399 !important;
}

/* Header & Sidebar Custom Colors */
.app-header {
    background-color: #122836 !important;
}

.app-sidebar {
    background-color: #1a3649 !important;
}

.app-sidebar-footer {
    background-color: #122836 !important;
}

/* Mobile Sidebar Stacking Context & Elevation */
@media (max-width: 1023px) {
    .app-header {
        z-index: 50 !important;
    }
    #sidebar {
        z-index: 50 !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
    }
}

/* Sidebar Navigation Scrollability (Mobile & Desktop) */
#sidebar nav {
    overflow-y: auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

#sidebar nav::-webkit-scrollbar {
    width: 4px;
}

#sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
}

#sidebar nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}
