/* PK Green Theme for Navigation Frame */
/* 
To switch between options:
- Option 1 (Uniform): Use class "pk-green-uniform" on body (currently active)
- Option 2 (Contrast): Change body class to "pk-green-contrast" for dark top/lighter sidebar
*/
:root {
    --pk-green: #475e25;
    --pk-green-dark: #3a4e1f;
    --pk-green-light: #5a7a2f;
    --pk-green-lighter: #6b8a3a;
    --sidebar-width: 300px;
}

/* Option 1: Same PK Green for both top and sidebar */
.pk-green-uniform .sb-topnav.navbar-dark {
    background-color: var(--pk-green) !important;
}

.pk-green-uniform .sb-sidenav-dark {
    background-color: var(--pk-green) !important;
}

/* Option 2: Dark top with lighter sidebar */
.pk-green-contrast .sb-topnav.navbar-dark {
    background-color: var(--pk-green-dark) !important;
}

.pk-green-contrast .sb-sidenav-dark {
    background-color: var(--pk-green-light) !important;
}

/* Top Navigation Bar - PK Green */
.sb-topnav.navbar-dark {
    background-color: var(--pk-green) !important;
}

    .sb-topnav.navbar-dark .navbar-brand {
        color: #fff !important;
    }

    .sb-topnav.navbar-dark .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.8) !important;
    }

        .sb-topnav.navbar-dark .navbar-nav .nav-link:hover {
            color: #fff !important;
        }

    .sb-topnav.navbar-dark #sidebarToggle {
        color: rgba(255, 255, 255, 0.8) !important;
    }

        .sb-topnav.navbar-dark #sidebarToggle:hover {
            color: #fff !important;
        }

/* Sidebar - PK Green */
.sb-sidenav-dark {
    background-color: var(--pk-green) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

    .sb-sidenav-dark .sb-sidenav-menu .sb-sidenav-menu-heading {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .sb-sidenav-dark .sb-sidenav-menu .nav-link {
        color: rgba(255, 255, 255, 0.8) !important;
    }

        .sb-sidenav-dark .sb-sidenav-menu .nav-link .sb-nav-link-icon {
            color: rgba(255, 255, 255, 0.6) !important;
        }

        .sb-sidenav-dark .sb-sidenav-menu .nav-link .sb-sidenav-collapse-arrow {
            color: rgba(255, 255, 255, 0.6) !important;
        }

        .sb-sidenav-dark .sb-sidenav-menu .nav-link:hover {
            color: #fff !important;
            background-color: var(--pk-green-dark) !important;
        }

            .sb-sidenav-dark .sb-sidenav-menu .nav-link:hover .sb-nav-link-icon {
                color: #fff !important;
            }

        .sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
            color: #fff !important;
            background-color: var(--pk-green-dark) !important;
        }

            .sb-sidenav-dark .sb-sidenav-menu .nav-link.active .sb-nav-link-icon {
                color: #fff !important;
            }

    .sb-sidenav-dark .sb-sidenav-footer {
        background-color: var(--pk-green-dark) !important;
    }

/* Footer colors for different options */
.pk-green-uniform .sb-sidenav-dark .sb-sidenav-footer {
    background-color: var(--pk-green-dark) !important;
}

.pk-green-contrast .sb-sidenav-dark .sb-sidenav-footer {
    background-color: var(--pk-green) !important;
}

/* Login footer styling */
.pk-login-footer {
    background-color: var(--pk-green-dark) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

    .pk-login-footer:hover {
        background-color: var(--pk-green) !important;
        color: #fff !important;
    }

/* Wider sidebar to accommodate the logo */
#layoutSidenav #layoutSidenav_nav {
    flex-basis: var(--sidebar-width) !important;
    transform: translateX(calc(-1 * var(--sidebar-width))) !important;
}

#layoutSidenav #layoutSidenav_content {
    margin-left: calc(-1 * var(--sidebar-width)) !important;
}

.sb-sidenav-toggled #layoutSidenav #layoutSidenav_nav {
    transform: translateX(0) !important;
}

.sb-sidenav-toggled #layoutSidenav #layoutSidenav_content {
    margin-left: calc(-1 * var(--sidebar-width)) !important;
}

.sb-nav-fixed #layoutSidenav #layoutSidenav_nav {
    width: var(--sidebar-width) !important;
}

.sb-nav-fixed #layoutSidenav #layoutSidenav_content {
    padding-left: var(--sidebar-width) !important;
}

.sb-topnav .navbar-brand {
    width: var(--sidebar-width) !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    #layoutSidenav_content {
        padding-left: var(--sidebar-width) !important;
    }
}

/* Fix hamburger menu positioning */
.sb-topnav {
    padding-left: 0 !important;
    height: 56px !important;
    z-index: 1039 !important;
}

    .sb-topnav .navbar-brand {
        width: var(--sidebar-width) !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin: 0 !important;
    }

/* Ensure hamburger menu doesn't overlap content */
#sidebarToggle {
    position: relative !important;
    z-index: 1040 !important;
    margin-left: 0 !important;
}

/* Fix hamburger menu positioning when sidebar is expanded */
@media (min-width: 992px) {
    #sidebarToggle {
        position: absolute !important;
        left: var(--sidebar-width) !important;
        margin-left: 0 !important;
        z-index: 1040 !important;
    }
}

/* When sidebar is toggled/collapsed, reset hamburger position */
.sb-sidenav-toggled #sidebarToggle {
    position: relative !important;
    left: auto !important;
    margin-left: 0 !important;
}

/* Adjust main content area to prevent overlap */
.sb-nav-fixed #layoutSidenav #layoutSidenav_content {
    padding-left: var(--sidebar-width) !important;
    padding-top: 56px !important;
    top: 56px !important;
    width: calc(100% - var(--sidebar-width)) !important;
    margin-left: 0 !important;
}

/* Ensure content is properly positioned when sidebar is expanded */
@media (min-width: 992px) {
    #layoutSidenav #layoutSidenav_content {
        margin-left: calc(-1 * var(--sidebar-width)) !important;
        width: 100% !important;
    }

    .sb-sidenav-toggled #layoutSidenav #layoutSidenav_content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Force sidebar to be expanded by default, but allow toggle to work */
body:not(.sb-sidenav-toggled) #layoutSidenav #layoutSidenav_nav {
    transform: translateX(0) !important;
}

body:not(.sb-sidenav-toggled) #layoutSidenav #layoutSidenav_content {
    margin-left: 0 !important;
}

/* Allow toggle functionality to work */
body.sb-sidenav-toggled #layoutSidenav #layoutSidenav_nav {
    transform: translateX(calc(-1 * var(--sidebar-width))) !important;
}

body.sb-sidenav-toggled #layoutSidenav #layoutSidenav_content {
    margin-left: calc(-1 * var(--sidebar-width)) !important;
}

/* Hide sidebar during login */
body.login-page #layoutSidenav_nav,
body.login-page #layoutSidenav_nav * {
    display: none !important;
    visibility: hidden !important;
}

body.login-page #layoutSidenav_content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.login-page .sb-topnav {
    background-color: var(--pk-green) !important;
    box-shadow: none !important;
}

    body.login-page .sb-topnav.navbar-light {
        background-color: var(--pk-green) !important;
    }

    body.login-page .sb-topnav .navbar-brand {
        color: white !important;
    }

    /* Force all top navigation elements to be green */
    body.login-page .sb-topnav,
    body.login-page .sb-topnav *,
    body.login-page #idnavtop,
    body.login-page #idnavtop * {
        background-color: var(--pk-green) !important;
    }

/* Ensure the top bar is green even when scrolling */
body.login-page .fixed-top,
body.login-page .sb-nav-fixed .sb-topnav {
    background-color: var(--pk-green) !important;
}

/* Keep the green top navigation bar but ensure it's fully green */
body.login-page .sb-topnav {
    background-color: var(--pk-green) !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Target any potential white elements that might be causing the strip */
body.login-page .navbar,
body.login-page .navbar-brand,
body.login-page .navbar-nav,
body.login-page .navbar-nav *,
body.login-page .container-fluid,
body.login-page .container-fluid * {
    background-color: var(--pk-green) !important;
}

/* Ensure no white borders or gaps */
body.login-page .sb-topnav,
body.login-page .sb-topnav * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* More aggressive targeting of white elements */
body.login-page header,
body.login-page header *,
body.login-page .header,
body.login-page .header *,
body.login-page .top-bar,
body.login-page .top-bar *,
body.login-page .main-header,
body.login-page .main-header *,
body.login-page .site-header,
body.login-page .site-header *,
body.login-page .page-header,
body.login-page .page-header * {
    background-color: var(--pk-green) !important;
    color: white !important;
}

/* Target any potential white background on body or html */
body.login-page,
body.login-page html {
    background-color: var(--pk-green) !important;
    background-image: none !important;
    background: var(--pk-green) !important;
}

    /* Ensure uniform green background - no gradients or variations */
    body.login-page .login-background,
    body.login-page .login-container,
    body.login-page .container,
    body.login-page .container-fluid,
    body.login-page .row,
    body.login-page .col,
    body.login-page .col-* {
        background-color: var(--pk-green) !important;
        background-image: none !important;
        background: var(--pk-green) !important;
    }

    /* Preserve button and form element styling */
    body.login-page .btn,
    body.login-page .btn-login,
    body.login-page .form-control,
    body.login-page input,
    body.login-page .login-card {
        background-image: none !important;
    }

    /* Ensure login card has white background */
    body.login-page .login-card {
        background-color: white !important;
        background: white !important;
    }

    /* Ensure sign-in button has proper styling */
    body.login-page .btn-login {
        background-color: var(--pk-green) !important;
        background: var(--pk-green) !important;
        color: white !important;
        border: none !important;
    }

    /* Ensure the top of the page is green */
    body.login-page::before,
    body.login-page::after {
        display: none !important;
    }

    /* Adjust login container to account for the top bar */
    body.login-page .login-container {
        margin-top: 20px !important;
        padding-top: 20px !important;
    }

    /* Force hide sidebar completely */
    body.login-page #layoutSidenav {
        display: flex !important;
    }

        body.login-page #layoutSidenav #layoutSidenav_nav {
            width: 0 !important;
            min-width: 0 !important;
            max-width: 0 !important;
            flex-basis: 0 !important;
            flex-shrink: 0 !important;
            overflow: hidden !important;
        }

        body.login-page #layoutSidenav #layoutSidenav_content {
            flex: 1 !important;
            margin-left: 0 !important;
            padding-left: 0 !important;
            width: 100% !important;
        }

/* Beautiful Login Page Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--pk-green) 0%, var(--pk-green-dark) 100%);
    padding: 20px;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo-img {
    max-width: 250px;
    height: auto;
}

.login-title {
    color: var(--pk-green);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'Brandon Text', sans-serif;
}

.login-subtitle {
    color: #666;
    font-size: 16px;
    margin: 0;
    font-family: 'Brandon Text', sans-serif;
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--pk-green);
    font-weight: 600;
    font-size: 14px;
    font-family: 'Brandon Text', sans-serif;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--pk-green);
    z-index: 2;
}

.login-input {
    padding: 15px 15px 15px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

    .login-input:focus {
        border-color: var(--pk-green);
        box-shadow: 0 0 0 3px rgba(71, 94, 37, 0.1);
        outline: none;
    }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--pk-green);
}

.form-check-label {
    color: #666;
    font-size: 14px;
    font-family: 'Brandon Text', sans-serif;
}

.forgot-password {
    color: var(--pk-green);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

    .forgot-password:hover {
        color: var(--pk-green-dark);
        text-decoration: underline;
    }

.form-submit {
    text-align: center;
}

.btn-login {
    background: linear-gradient(135deg, var(--pk-green) 0%, var(--pk-green-dark) 100%);
    border: none;
    color: white;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
    font-family: 'Brandon Text', sans-serif;
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(71, 94, 37, 0.3);
        color: white;
    }

    .btn-login:active {
        transform: translateY(0);
    }

.validation-summary {
    /* Remove persistent red box styling; keep space for inline red text */
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    color: #dc3545; /* match text-danger */
    font-size: 14px;
}

.text-danger {
    color: #dc3545 !important;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Responsive adjustments for login */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
    }

    .login-title {
        font-size: 24px;
    }

    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Welcome Page Styling (for non-authenticated users) */
.welcome-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--pk-green) 0%, var(--pk-green-dark) 100%);
    padding: 20px;
}

.welcome-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.welcome-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.welcome-header {
    margin-bottom: 40px;
}

.welcome-logo {
    margin-bottom: 30px;
}

.welcome-logo-img {
    max-width: 300px;
    height: auto;
}

.welcome-title {
    color: var(--pk-green);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Brandon Text', sans-serif;
}

.welcome-subtitle {
    color: #666;
    font-size: 18px;
    margin: 0;
    font-family: 'Brandon Text', sans-serif;
}

.welcome-actions {
    margin-top: 40px;
}

.btn-welcome {
    background: linear-gradient(135deg, var(--pk-green) 0%, var(--pk-green-dark) 100%);
    border: none;
    color: white;
    padding: 18px 50px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Brandon Text', sans-serif;
}

    .btn-welcome:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(71, 94, 37, 0.3);
        color: white;
        text-decoration: none;
    }

    .btn-welcome:active {
        transform: translateY(0);
    }

/* Responsive adjustments for welcome page */
@media (max-width: 768px) {
    .welcome-card {
        padding: 40px 30px;
        margin: 10px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }

    .btn-welcome {
        padding: 15px 40px;
        font-size: 16px;
    }
}
