/**
 * ConfigSentry - Global Styles
 * Shared across all authenticated and public pages
 */
 
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    
    overflow-x: hidden; /* needed so header doesn't move on scroll in mobile */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-width: 340px;
    
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
    padding-top: 48px; /* holds main Audity header only */
}

header {
    flex-shrink: 0;
    Xposition: static;
    position: fixed;
    z-index: 10000;
    width: 100%;
    top: 0px;
    
    display: flex;
    height: 48px;
    box-shadow: 1px 0rem 1rem 0px rgba(0, 0, 0, .15) !important;
    border-bottom: #c7c8c9 solid 1px;
    background: #ffffff;
    justify-content: flex-end;
}

/* Header */
.top-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 48px;
    width: 100%;
    min-height: 48px;
    z-index: 1000;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    position: static;
    
    width: 100%;
    padding: 20px;
    text-align: center;
    line-height: 1.5em;
}

input[readonly], input[readonly]:focus,
textarea[readonly], textarea[readonly]:focus,
textarea:disabled, textarea:disabled:focus,
.form-control[readonly], .form-control[readonly]:focus,
.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef !important;
    color: #212529 !important;
    opacity: 1 !important;
}

.dropdown button {
    border-radius: var(--bs-border-radius) !important;
}

.dropdown .btn-outline-secondary.dropdown-toggle:not([disabled]):not([data-readonly-dropdown="true"]),
.dropdown .btn-outline-secondary.dropdown-toggle:not([disabled]):not([data-readonly-dropdown="true"]):focus,
.dropdown .btn-outline-secondary.dropdown-toggle:not([disabled]):not([data-readonly-dropdown="true"]):hover,
.dropdown .btn-outline-secondary.dropdown-toggle:not([disabled]):not([data-readonly-dropdown="true"]):active {
    color: #212529 !important;
}

.dropdown button[disabled],
.dropdown .dropdown-toggle[data-readonly-dropdown="true"],
.dropdown .dropdown-toggle[data-readonly-dropdown="true"]:focus,
.dropdown .dropdown-toggle[data-readonly-dropdown="true"]:hover {
    background-color: #e9ecef !important;
    color: #212529 !important;
    border-color: #ced4da !important;
    opacity: 1 !important;
    box-shadow: none !important;
    background-image: none !important;
}

.dropdown .dropdown-toggle[data-readonly-dropdown="true"] {
    cursor: pointer;
}

.dropdown .dropdown-toggle[data-readonly-dropdown="true"]::after {
    opacity: 1;
}

.dropdown-menu[data-readonly-dropdown-menu="true"] {
    pointer-events: none !important;
    --bs-dropdown-link-hover-bg: transparent !important;
    --bs-dropdown-link-active-bg: transparent !important;
    --bs-dropdown-link-hover-color: #212529 !important;
    --bs-dropdown-link-active-color: #212529 !important;
}

.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item,
.dropdown-menu[data-readonly-dropdown-menu="true"] .form-check-label,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item:hover,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item:focus,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item:active,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item.active,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item:focus-visible,
.dropdown-menu[data-readonly-dropdown-menu="true"] label.dropdown-item:hover,
.dropdown-menu[data-readonly-dropdown-menu="true"] label.dropdown-item:focus,
.dropdown-menu[data-readonly-dropdown-menu="true"] label.dropdown-item:active {
    background-color: transparent !important;
    color: #212529 !important;
    text-decoration: none !important;
    cursor: default !important;
}

.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-item,
.dropdown-menu[data-readonly-dropdown-menu="true"] .dropdown-divider,
.dropdown-menu[data-readonly-dropdown-menu="true"] .form-check-input,
.dropdown-menu[data-readonly-dropdown-menu="true"] .form-control,
.dropdown-menu[data-readonly-dropdown-menu="true"] .form-select,
.dropdown-menu[data-readonly-dropdown-menu="true"] .form-check-label,
.dropdown-menu[data-readonly-dropdown-menu="true"] span,
.dropdown-menu[data-readonly-dropdown-menu="true"] label {
    pointer-events: none !important;
}

.textarea-minimal {
    border: 0;
    width: 100%;
    resize: none;
}

.topbarlogo {
    margin-top: auto;
    margin-bottom: auto;
    margin-left: 10px;
    margin-right: auto;
}

  .topbarlogo img {
    height: 40px;
    margin-right: 10px;
  }

/* Responsive Logo Classes */
/*.hide_when_small {
    display: inline-block;
}

.hide_when_very_small {
    display: inline-block;
}*/

.show_when_small {
    display: none;
}

.show_when_very_small {
    display: none;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333;
    
    font-size: 18px;
    font-weight: 600;
    margin-left: 16px;
}

.logo-title:hover {
    color: #0066cc;
    text-decoration: none;
}

.logo-title img {
    height: 32px;
    width: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 450px) {
  .hide-if-small {
    display: none;
  }
}

/* Account Dropdown */
.account-dropdown {
    min-width: 250px;
    position: relative;
    overflow: visible;
}

.account-selector-trigger {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    min-width: 250px;
    justify-content: space-between;
    height: 48px;
    padding-bottom: 6px;
    border: 0;
    background: #fff;
}

.account-selector-trigger:hover {
    background: #e9ecef;
}

.account-selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.account-selector-dropdown.show {
    display: block;
}

.account-selector-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.account-selector-item:hover {
    background: #f8f9fa;
}

.account-selector-item.active {
    background: #e3f2fd;
    font-weight: 600;
}

.account-logo {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}

.account-logo-placeholder {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    Xbackground: #f8f9fa;
    Xborder: 1px solid #dee2e6;
    height: 48px;
    padding-bottom: 6px;
    border: 0;
    background: #fff;
}

.user-menu-trigger:hover {
    background: #e9ecef;
}

.user-menu-email {
    font-size: 14px;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1001;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}

.user-menu-item:hover {
    background: #f8f9fa;
    color: #0066cc;
    text-decoration: none;
}

.user-menu-item i {
    margin-right: 8px;
    width: 16px;
}

/* Layout */
.layout-container {
    display: flex;
    min-height: calc(100vh - 96px);
}

/* Mobile Responsive */
@media (max-width: 450px) {
  /* Layout */
  .layout-container {
      margin-top: 70px; /* offset for fixed .top-header (body already offsets for fixed header) */
  }  
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 3px 0;
}

.sidebarfiller {
  /* needed because sidebar doesn't go down to the buttom of the page */
  position: fixed;
  bottom: 0px;
  height: 100%;
  z-index: -1;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 12px 24px;
    color: #333;
    text-decoration: none;
    transition: all 0.15s;
}

.sidebar-nav a:hover {
    background: #f8f9fa;
    color: #0066cc;
}

.sidebar-nav a.active {
    background: #e3f2fd;
    color: #0066cc;
    border-right: 3px solid #0066cc;
}

.sidebar-nav a i {
    margin-right: 8px;
    width: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

/* Account Links Bold No Underline */
.account-link {
    font-weight: 600;
    text-decoration: none !important;
}

.account-link:hover {
    color: #0066cc;
    text-decoration: none !important;
}

/* Password Requirements */
.password-requirements {
    font-size: 0.85em;
    color: #666;
    margin-top: 6px;
}

/* Honeypot Field */
.form-field--trap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Mobile Responsive */
@media (max-width: 450px) {
    .hide_when_very_small {
        display: none !important;
    }
    
    .show_when_very_small {
        display: inline-block !important;
    }
}

@media (max-width: 768px) {
    .hide_when_small {
        display: none !important;
    }
    
    .show_when_small {
        display: inline-block !important;
    }
    
    /* Hide email text in user menu on mobile */
    .user-menu-email {
        display: none;
    }
    
    /* Stack header items */
    .top-header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .logo-title img {
        height: 24px;
        width: 24px;
    }
    
    /* Smaller account dropdown */
    .account-dropdown {
        min-width: 150px;
    }
    
    .account-selector-trigger {
        min-width: 150px;
        padding: 6px 8px;
        font-size: 13px;
    }
    
    /* Hide sidebar on mobile, make it collapsible */
    .sidebar {
        position: fixed;
        left: -240px;
        top: 96px;
        height: calc(100vh - 96px);
        z-index: 9999999;
        transition: left 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    /* Add menu toggle button */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 4px;
    }
    
    /* Main content full width on mobile */
    .main-content {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .Xlogo-title h1 {
        font-size: 16px;
    }
    
    .account-dropdown {
        min-width: 120px;
    }
    
    .account-selector-trigger {
        min-width: 120px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 12px;
    }
}

/* Desktop - hide mobile menu toggle */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Overwrite some bootstrap css default, for all */
.btn {
    text-decoration: none;
    border-radius: var(--bs-border-radius) !important;
}

.btn:hover {
   text-decoration: none;
}

.btn-primary, .btn-outline-primary {
    --bs-btn-color: #fff;

    X--bs-btn-bg: #fc7406;
    X--bs-btn-border-color: #fa5408;
    --bs-btn-bg: #FF6B35;
    --bs-btn-border-color: #FF6B35;

    --bs-btn-hover-color: #fff;

    X--bs-btn-hover-bg: #fa5408;
    X--bs-btn-hover-border-color: #f83f0b;
    --bs-btn-hover-bg: #FF8555;
    --bs-btn-hover-border-color: #FF8555;

    --bs-btn-active-color: #fff;

    X--bs-btn-active-bg: #0a58ca;
    X--bs-btn-active-border-color: #0a53be;
    --bs-btn-active-bg: #FF8555;
    --bs-btn-active-border-color: #FF8555;

    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #6c757d;
    --bs-btn-disabled-border-color: #61666b;
}

.btn-group-sm a.btn, .btn-group-sm button.btn {
    border-radius:0px !important;
}
.btn-group-sm a.btn:first-child, .btn-group-sm button.btn:first-child {
    border-radius:6px 0 0 6px !important;
}

.btn-group-sm a.btn:last-child, .btn-group-sm button.btn:last-child {
    border-radius:0 6px 6px 0 !important;
}

.container {
    margin-bottom: 80px !important;
}

/* Overwrite some bootstrap css default, for small displays */
@media (max-width: 450px) {
  .container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl
    {
        padding-right: 0px !important;
        padding-left: 0px !important;
    }
   
    .mb-5 {
        Xmargin-bottom: 0px !important;
    }

    .mt-5 {
        Xmargin-top: 0px !important;
    }
    
    .shadow {
        box-shadow: none !important;
    }

    .card {
        border: 0px !important;
    }
    
    body {
        background: #fff !important;
    }
    
    /* view-audit */
    #shareLinksTable thead {
      display: none;
    }
    
    #shareLinksBody tr td {
      display: block;
    }
}
