/*
 * ISKCON Devotee Care - Custom Stylesheet v5
 * Final responsive fixes with overlay and correct mobile positioning.
 * Author: Gemini AI
 */

:root {
    --primary-saffron: #f0ad4e;
    --primary-blue: #0d6efd;
    --secondary-blue: #0a58ca;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #343a40;
    --border-color: #dee2e6;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-bg);
    overflow-x: hidden;
}

#wrapper { display: flex; }

#sidebar-wrapper {
    min-height: 100vh;
    width: 260px;
    margin-left: 0;
    transition: margin .25s ease-out;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1031; 
}

#page-content-wrapper { min-width: 0; width: 100%; }

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

#wrapper.toggled .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* Toggled state (for desktop) */
#wrapper.toggled #sidebar-wrapper {
    margin-left: -260px;
}

/* =================== MOBILE VIEW FIX =================== */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        /* CRITICAL: Makes the sidebar a fixed element that can slide in from the left */
        position: fixed;
        /* Start off-screen */
        margin-left: -260px; 
    }
    
    /* When toggled on mobile, slide the sidebar into view */
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    
    /* The page content wrapper should now always take up the full screen width */
    #page-content-wrapper {
        min-width: 100vw;
    }
}
/* =================== END OF FIX =================== */

/* --- ALL OTHER STYLES (Sidebar Content, Navbar, Cards, etc.) --- */
#sidebar-wrapper .sidebar-heading { padding: 1rem 1.25rem; font-size: 1.4rem; font-weight: 700; color: var(--white); background-color: var(--primary-saffron); }
#sidebar-wrapper .list-group-item { border: none; padding: 1rem 1.5rem; font-size: 1rem; color: #555; transition: all 0.2s ease-in-out; }
#sidebar-wrapper .list-group-item:hover { background-color: var(--light-bg); color: var(--primary-blue); transform: translateX(5px); }
#sidebar-wrapper .list-group-item.active { background-color: var(--primary-blue); color: var(--white); border-left: 5px solid var(--primary-saffron); font-weight: bold; }
#sidebar-wrapper .list-group-item i { min-width: 30px; text-align: center; }
.navbar { box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
.navbar .nav-link { color: #555; }
.navbar .nav-link:hover { color: var(--primary-blue); }
#sidebarToggle { background-color: var(--primary-blue); border: none; }
#sidebarToggle:hover { background-color: var(--secondary-blue); }
.card { border: none; border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.card-header { font-weight: 500; background-color: var(--white); border-bottom: 1px solid var(--border-color); }
.stat-card { color: var(--white); }
.stat-card .card-body i { opacity: 0.3; }
.stat-card .card-footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.stat-card .card-footer a:hover { color: var(--white); }
.progress { height: 1.25rem; font-size: 0.85rem; border-radius: 0.25rem; }
.progress-bar { background-color: var(--primary-saffron); }
.table { vertical-align: middle; }
.table thead { background-color: var(--light-bg); }
.table .action-icons a { color: #6c757d; margin: 0 5px; font-size: 1.1rem; text-decoration: none; }
.btn-primary { background-color: var(--primary-blue); border-color: var(--primary-blue); }
.btn-primary:hover { background-color: var(--secondary-blue); border-color: var(--secondary-blue); }
.btn-saffron { background-color: var(--primary-saffron); color: var(--white); border-color: var(--primary-saffron); }
.btn-saffron:hover { background-color: #e69527; border-color: #e69527; color: var(--white); }
.badge { font-size: 0.8rem; font-weight: 500; }
.at-risk-flag { color: #dc3545; font-weight: bold; }