:root {
    --primary-nav-color: #005073;
    --google-blue: #4285F4;
    --google-red: #DB4437;
    --google-yellow: #F4B400;
    --google-green: #0F9D58;
    --anymcp-glass:  rgba(0, 0, 0, 0.6);
}

body {
    background-color: black;
    overflow-x: hidden;
    letter-spacing: 0.6px;
}

.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 20px;
    transition: all 0.3s;
    z-index: 1030;
    border-right: 1px solid #343a40;
    font-weight: 600;
    background-color: var(--anymcp-glass);
    overflow-y: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 0 1.5rem 1rem;
}

.sidebar .nav-link {
    padding: 1rem 1.5rem;
    transition: background-color 0.2s;
    font-size: large;
    font-weight: 100;
}

/* --- MODIFICATION START --- */

/* Universal hover state for all nav links */
.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Style for an active parent drawer link (e.g., "MCP") */
.sidebar .nav-link.active[data-bs-toggle="collapse"] {
    color: #fff; /* Keep text bright to indicate it's open/active */
    /* No background color, so it doesn't look like the primary selection */
}

/* Style for the actual selected page link (top-level or child) */
.sidebar .nav-link.active:not([data-bs-toggle="collapse"]),
.sidebar .nav-link.active-child {
    background-color: rgba(255, 255, 255, 0.1); /* This is the highlight */
    color: #fff;
}

/* Styling for nested drawer items for visual hierarchy */
.sidebar .collapse .nav-link {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: medium; /* Make them slightly smaller than top-level items */
}

/* --- MODIFICATION END --- */


.sidebar .nav-link .fa-chevron-down {
    transition: transform 0.3s;
}

.sidebar .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.main-content {
    position: relative;
    margin-left: 250px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s, width 0.3s;
}

.main-content .navbar {
    border-bottom: 1px solid #343a40;
    height: 5rem;
    padding: 1rem;
    background-color: var(--anymcp-glass);
}

.content-area {
    padding: 2rem;
}

.global-video {
    opacity: 0.6;
}

.global-hover:hover {
    opacity: 0.6;
}


/* ADDED: Styles for the sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}


.card {
    background-color: unset !important;
}

table {
    --bs-table-bg: unset !important;
}

.form-control, .form-select {
    background-color: unset !important;
}

option {
    color: black !important;
}

.gblue {
    color: var(--google-blue)
}

.ggreen {
    color: var(--google-green)
}

.gred {
    color: var(--google-red)
}

.gyellow {
    color: var(--google-yellow)
}


.form-select:disabled {
    background-color: rgba(50, 50, 50, 0.2) !important;
    color: rgba(110, 110, 110, 0.5) !important;
}

.btn-gred {
    --bs-btn-color: #fff;
    --bs-btn-bg: #DB4437;
    --bs-btn-border-color: #DB4437;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #c53d32;
    --bs-btn-hover-border-color: #b0382d;
    --bs-btn-focus-shadow-rgb: 228, 94, 84;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b0382d;
    --bs-btn-active-border-color: #a03329;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #DB4437;
    --bs-btn-disabled-border-color: #DB4437;
}

h1, h4, h5 {
    color: var(--google-blue) !important;
    margin-bottom: 0.1rem !important;
    font-weight: 100 !important;
}

.menu-icon {
    border: solid;
    border-width: 1px;
    padding: 0px;
    padding-left: 5px;
    padding-right: 5px;
}

.td-center {
    text-align: center;
    align-content: center;
    justify-items: center;
}

.btn-minw {
    min-width: 4rem;
}


/* ADDED: Media query for mobile responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        left: -250px;
    }

    .sidebar.active {
        left: 0;
        background-color: rgba(0, 0, 0, 0.9);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .login-body {
        padding-bottom: 15rem;
    }
}


.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    z-index: 2;
}

#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.card {
    background-color: #212529;
    border: 1px solid #343a40;
}

.modal-content {
    background-color: #212529;
    border: 1px solid #343a40;
}

.modal-header, .modal-footer {
     border-bottom: 1px solid #343a40;
     border-top: 1px solid #343a40;
}

.list-group-item {
    background-color: unset;
    border: 1px solid #343a40;
}

.form-control, .form-select {
    background-color: #2c3034;
    color: #fff;
    border: 1px solid #495057;
}

.form-control:focus, .form-select:focus {
    background-color: #2c3034;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

.table {
    color: #dee2e6;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.05);
}

.parameter-group {
    border: 1px solid #495057;
    border-radius: .375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Styles for connection status indicator */
.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px; /* Same height as button */
}

.status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #6c757d; /* Default gray */
    transition: background-color 0.3s;
}
.status-indicator.status-ok {
    background-color: var(--google-green);
    box-shadow: 0 0 8px var(--google-green);
}
.status-indicator.status-error {
    background-color: var(--google-red);
    box-shadow: 0 0 8px var(--google-red);
}
#connection-status-message {
    font-size: 0.9em;
    font-weight: bold;
}

/* Feature 1: Password visibility toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper .form-control {
    padding-right: 3rem; /* Make space for the icon */
}
.password-toggle-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 5;
    color: #adb5bd;
}
.password-toggle-icon:hover {
    color: #fff;
}


/* Feature 3: Sortable table headers */
.table-sortable th {
    cursor: pointer;
    user-select: none;
}
.table-sortable th:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.table-sortable th::after {
    content: '';
    display: inline-block;
    margin-left: 0.5em;
    opacity: 0.3;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}
.table-sortable th.sorted-asc::after {
    opacity: 1;
    border-bottom: 5px solid;
}
.table-sortable th.sorted-desc::after {
    opacity: 1;
    border-top: 5px solid;
}

/* --- Feature 5: Global button spinner (REDONE) --- */
.btn.btn-loading {
    position: relative;
    color: transparent !important; /* Hide button text */
}

/* Define the rotation animation */
@keyframes spinner-animation {
    to {
        transform: rotate(360deg);
    }
}

.btn.btn-loading::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    /* Centering the spinner */
    top: 50%;
    left: 50%;
    /* Sizing relative to the button's font size */
    width: 1.2em;
    height: 1.2em;
    margin-top: -0.6em;  /* half of the height */
    margin-left: -0.6em; /* half of the width */
    
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #ffffff; /* This creates the visible spinning part */
    
    animation: spinner-animation .6s linear infinite;
}

/* Adjust spinner size for different button sizes */
.btn-sm.btn-loading::after {
    width: 1em;
    height: 1em;
    margin-top: -0.5em;
    margin-left: -0.5em;
}
.btn-lg.btn-loading::after {
    width: 1.4em;
    height: 1.4em;
    margin-top: -0.7em;
    margin-left: -0.7em;
    border-width: 3px;
}