/* pointage-app/public/css/style.css */

/* Login View Specific styles - these remain the same */
body.login-page-active {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa; /* Ensure body BG for login page */
}
#login-view-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
}
.login-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
/* Hide app elements when login is active */
body.login-page-active #app-view-wrapper {
    display: none !important;
}


/* App View Styles */
body.app-page-active { /* Renamed from just 'body' to be specific */
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background-color: #f8f9fa;
}

#app-view-wrapper .wrapper { /* Added #app-view-wrapper prefix for specificity */
    display: flex;
    width: 100%;
    align-items: stretch;
    flex-grow: 1;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #343a40;
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1031; 
    margin-left: -250px; /* HIDDEN BY DEFAULT (mobile-first) */
    transition: margin-left 0.3s ease-in-out;
    padding-top: 56px; /* Space for fixed navbar */
    overflow-y: auto;
}

#content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    margin-left: 0; /* FULL WIDTH BY DEFAULT (mobile-first) */
    padding-top: 76px; /* Space for fixed navbar */
    transition: margin-left 0.3s ease-in-out;
}

.navbar-custom {
    position: fixed;
    top: 0;
    right: 0;
    left: 0; /* FULL WIDTH BY DEFAULT (mobile-first) */
    z-index: 1030;
    background-color: #ffffff; /* Changed from #f8f9fa for better contrast if content is light */
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: left 0.3s ease-in-out;
    height: 56px;
}

/* --- DESKTOP STYLES (min-width: 768px, e.g., md breakpoint) --- */
@media (min-width: 768px) {
    /* Default state on desktop: sidebar visible */
    body.app-page-active:not(.sidebar-collapsed-by-user) #sidebar {
        margin-left: 0;
    }
    body.app-page-active:not(.sidebar-collapsed-by-user) #content {
        width: calc(100% - 250px); /* Adjust content width */
        margin-left: 250px;
        transition: all 0.3s;
    }
    body.app-page-active:not(.sidebar-collapsed-by-user) .navbar-custom {
        left: 250px;
    }

    /* State when sidebar is explicitly collapsed by user on desktop */
    body.app-page-active.sidebar-collapsed-by-user #sidebar {
        margin-left: -250px;
    }
    body.app-page-active.sidebar-collapsed-by-user #content {
        width: calc(100% - 0px); /* Adjust content width */
        margin-left: 0;
        transition: all 0.3s;
    }
    body.app-page-active.sidebar-collapsed-by-user .navbar-custom {
        left: 0;
    }
}

/* --- MOBILE/TABLET STYLES (max-width: 767.98px) --- */
@media (max-width: 767.98px) {
    /* When toggle button makes sidebar active on mobile */
    #sidebar.active { /* JS will toggle this class on #sidebar for mobile */
        margin-left: 0;
    }
    /* If content should be pushed on mobile when sidebar is active */
    /* Ensure these classes are also toggled by JS for mobile */
     #content.sidebar-active {
        margin-left: 250px;
    }
     .navbar-custom.sidebar-active {
        left: 250px;
    }

    /* User's original responsive adjustments for mobile */
    /* Keep if still relevant, but sidebar logic is now more specific above */
     #sidebarCollapse span {
        display: none;
    }
}


/* Remaining sidebar, content, main-content, and utility styles */
#sidebar .sidebar-header {
    padding: 15px 20px;
    background: #212529;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
}

#sidebarLogo {
    height: 35px; /* Adjust as needed */
    width: auto; /* Maintain aspect ratio */
    margin-right: 10px; /* Space between logo and title */
    vertical-align: middle; /* Helps if Bootstrap flex align-items is not sufficient */
}

#sidebar .sidebar-header h3 {
    font-size: 1.5em; /* Existing */
    font-weight: bold; /* Existing */
    color: #fff; /* Ensure text color contrasts with dark background */
    margin: 0; /* Ensure no extra margins affecting alignment */
    line-height: 1; /* Adjust line height if needed for vertical centering with logo */
}

#sidebar ul.components {
    padding: 20px 0;
    border-bottom: 1px solid #474747;
}
#sidebar ul p {
    color: #fff;
    padding: 10px 20px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#sidebar ul li a {
    padding: 10px 20px;
    font-size: 1.1em;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}
#sidebar ul li a:hover {
    color: #fff;
    background: #495057;
}
#sidebar ul li.active > a { /* For active menu item highlighting */
    color: #fff;
    background: #007bff;
}
#sidebar ul.CTAs {
    padding: 20px;
}
#sidebar ul.CTAs a {
    text-align: center;
    font-size: 0.9em !important;
    display: block;
    border-radius: 5px;
    margin-bottom: 5px;
}

#main-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 56px - 40px); /* navbar height - top/bottom padding of #content */
}

.clickable { cursor: pointer; }

.spinner-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
#loadingSpinnerLogin.spinner-container {
    background-color: transparent; /* Or same as app */
    position:absolute;
}
.spinner-container.show { display: flex; }

.table th, .table td { vertical-align: middle; }
.action-buttons button, .action-buttons a { margin-right: 5px; }
.action-buttons i { pointer-events: none; }

.modal-body { max-height: 70vh; overflow-y: auto; }
.modal-footer { border-top: 1px solid #dee2e6; }