html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #ffffff;
  color: #212529;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  direction: ltr;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  background-color: #ffffff;
  color: #6c757d;
}

.table-responsive {
    max-height: 500px;
    overflow-y: auto;
}

/* Clean white theme cards, tables, inputs */
.card { 
  background-color: #ffffff; 
  color: #212529; 
  border-color: #dee2e6; 
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* Separator for login page (OR divider) */
.separator {
  display: flex;
  align-items: center;
  text-align: center;
  color: #6c757d;
}
.separator::before,
.separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #dee2e6;
}
.separator::before {
  margin-left: 10px;
}
.separator::after {
  margin-right: 10px;
}
.separator-text {
  padding: 0 10px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-header { 
  background-color: #f8f9fa; 
  border-bottom-color: #dee2e6; 
  color: #212529;
}
.card-elevated { 
  box-shadow: 0 2px 8px rgba(0,0,0,.1); 
  border-radius: 8px; 
  overflow: hidden; 
  border: 1px solid #dee2e6;
}
.table { 
  color: #212529; 
}
.table-striped > tbody > tr:nth-of-type(odd) { 
  --bs-table-accent-bg: rgba(0,0,0,.02); 
  color: #212529; 
}
.table-dark { 
  --bs-table-bg: #f8f9fa; 
  --bs-table-color: #212529; 
}
.form-control, .form-select, .form-check-input { 
  background-color: #ffffff; 
  color: #212529; 
  border-color: #ced4da; 
}
.form-control::placeholder { 
  color: #6c757d; 
}
.form-control:focus, .form-select:focus { 
  border-color: #258cfb; 
  box-shadow: 0 0 0 .2rem rgba(37,140,251,.25); 
}

/* Badges and helpers */
.badge { 
  border: 1px solid rgba(0,0,0,.1); 
}
.text-muted { 
  color: #6c757d !important; 
}

/* Clean Navbar */
.premium-header {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 25px;
    border: none !important;
}
.premium-header .navbar { 
  padding-top: .75rem; 
  padding-bottom: .75rem; 
  border: none !important;
}
.logo-container { 
    height: auto; 
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: -30px;
    left: 0px;
}
.logo-container img {
    height: 200px;
    width: auto;
}
.navbar-brand { 
    font-size: 1.25rem; 
    font-weight: 700; 
    letter-spacing: .3px;
    color: #212529 !important;
    transition: opacity .2s;
}
.navbar-brand:hover { 
  opacity: .7; 
}
.brand-text {
    color: #212529;
}
.navbar-nav { 
  list-style: none; 
  gap: .25rem; 
}
.nav-link { 
    color: #212529 !important; 
    font-weight: 500;
    border-radius: 8px;
    transition: all .2s;
}
.nav-link:hover { 
    background-color: #f8f9fa;
    color: #212529 !important;
}

/* Tables: smaller density */
.table-sm > :not(caption) > * > * { 
  padding: .35rem .5rem; 
}

/* Utility gaps */
.gap-2 { 
  gap: .5rem !important; 
}
.gap-3 { 
  gap: 1rem !important; 
}

/* Links */
a { 
  color: #258cfb; 
}
a:hover { 
  color: #0d6efd; 
}

/* Headings */
h1 { 
  font-weight: 700; 
  letter-spacing: .2px; 
  color: #212529;
}
h2 { 
  font-weight: 600; 
  color: #212529;
}
h5 { 
  font-weight: 600; 
  color: #212529;
}

/* Privacy page center alignment fix */
.container .prose { 
  max-width: 800px; 
  margin-inline: auto; 
  line-height: 1.6; 
}

/* Hero section - clean and minimal */
.hero {
    padding: 48px 32px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    position: relative;
}
.hero-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f8f9fa;
    color: #212529;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #dee2e6;
}
.hero h1 { 
  margin: 0 0 16px 0; 
  font-size: 32px; 
  font-weight: 700; 
  color: #212529;
}
.hero p { 
  margin: 0; 
  color: #6c757d; 
  font-size: 18px; 
}
.hero .lead { 
  font-size: 18px; 
  line-height: 1.6; 
  color: #6c757d;
}

/* Feature Items */
.feature-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background .2s;
}
.feature-item:hover { 
  background-color: #f8f9fa; 
}
.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #258cfb;
    flex-shrink: 0;
    border: 1px solid #dee2e6;
}

/* Guide Steps */
.guide-step {
    position: relative;
    padding-left: 56px;
}
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #258cfb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}
.guide-step h6 { 
  margin: 2px 0 8px 0; 
  font-weight: 600; 
  color: #212529;
}

/* Buttons */
.btn-primary { 
  background-color: #258cfb; 
  border-color: #258cfb; 
  color: #ffffff;
}
.btn-primary:hover { 
  background-color: #0d6efd; 
  border-color: #0d6efd; 
}
.btn-outline-light { 
  border-color: #dee2e6; 
  color: #212529; 
}
.btn-outline-light:hover { 
  background-color: #f8f9fa; 
  border-color: #ced4da; 
}
.btn-outline-secondary { 
  border-color: #6c757d; 
  color: #6c757d; 
}
.btn-outline-secondary:hover { 
  background-color: #6c757d; 
  border-color: #6c757d; 
  color: #ffffff;
}

/* Navigation Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    background-color: #ffffff;
    color: #6c757d !important;
    border: 1px solid #dee2e6;
    border-bottom: none;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    background-color: #f8f9fa;
    color: #212529 !important;
    border-color: #258cfb;
}

.nav-tabs .nav-link.active {
    background-color: #258cfb !important;
    color: #ffffff !important;
    border-color: #258cfb;
    font-weight: 600;
}

.nav-tabs .nav-link i {
    margin-right: 6px;
}

/* Card header tabs integration */
.card-header-tabs {
    margin: -0.75rem -1.25rem;
    border-bottom: none;
}

.card-header-tabs .nav-link {
    border-radius: 0;
}

.card-header-tabs .nav-link:first-child {
    border-top-left-radius: 8px;
}

/* SPA Loader Styles */
.spa-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.spa-loader-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.spa-loader-content {
    text-align: center;
}

.spa-spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spa-spin 0.75s linear infinite;
    color: #0d6efd;
    margin: 0 auto;
}

@keyframes spa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spa-loader-text {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Custom Scrollbar - thin and minimal */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Query Complete Toast Styles */
.query-complete-toast {
    min-width: 300px;
    max-width: 400px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #198754;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.query-complete-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.query-complete-toast .toast-header {
    background-color: #d1e7dd;
    border-bottom: 1px solid #198754;
    font-weight: 600;
}

.query-complete-toast .toast-body {
    background-color: #ffffff;
    font-size: 14px;
    padding: 12px;
    text-align: center;
    font-weight: 500;
}

.query-complete-toast .toast-body:hover {
    background-color: #f8f9fa;
}

/* Animation for toast appearance */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.query-complete-toast.show {
    animation: slideInRight 0.4s ease-out;
}

/* RTL Support for textarea - smooth transitions */
textarea#query {
    transition: direction 0.2s ease, text-align 0.2s ease, padding 0.2s ease;
}

/* Ensure proper text rendering for Hebrew */
textarea#query[dir="rtl"] {
    unicode-bidi: embed;
}

/* Menu Sidebar Styles */
.menu-sidebar-enabled {
    display: flex;
    flex-direction: column;
}

.menu-sidebar {
    width: 280px;
    min-height: calc(100vh - 80px);
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: 80px; /* Changed from 0 to account for header height */
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 100;
    flex-shrink: 0;
    max-height: calc(100vh - 80px); /* Add max-height to enable internal scrolling */
}

.menu-sidebar.collapsed {
    transform: translateX(-100%);
}

.menu-sidebar.mobile {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1050;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.sidebar-toggle {
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
}

.sidebar-toggle:hover {
    color: #212529;
}

.sidebar-content {
    padding: 0.5rem 0;
}

/* Menu Tree Styles */
.menu-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0;
    padding: 0;
}

.menu-category-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 0.5rem;
}

.menu-category-header:hover {
    background-color: #e9ecef;
}

.menu-category-header:focus {
    outline: 2px solid #258cfb;
    outline-offset: -2px;
}

.menu-category-header:focus:not(:focus-visible) {
    outline: none;
}

.menu-link-item:focus {
    outline: 2px solid #258cfb;
    outline-offset: -2px;
}

.menu-link-item:focus:not(:focus-visible) {
    outline: none;
}

.menu-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #6c757d;
    transition: transform 0.2s;
}

.menu-toggle:hover {
    color: #212529;
}

.menu-chevron {
    transition: transform 0.2s;
    font-size: 0.75rem;
}

.menu-chevron.rotated {
    transform: rotate(90deg);
}

.menu-spacer {
    width: 1.5rem;
}

.menu-icon {
    display: flex;
    align-items: center;
    color: #258cfb;
    font-size: 1.1rem;
}

.menu-text {
    flex: 1;
    font-weight: 500;
    color: #212529;
}

.menu-category-content {
    padding-left: 1rem;
}

.menu-link {
    padding: 0.25rem 0;
}

.menu-link-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    padding-left: 2.5rem;
    color: #212529;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    gap: 0.5rem;
}

.menu-link-item:hover {
    background-color: #e9ecef;
    color: #258cfb;
}

.menu-link-item.active {
    background-color: #258cfb;
    color: #ffffff;
}

.menu-link-icon {
    font-size: 0.9rem;
}

.menu-link-text {
    flex: 1;
}

.menu-sublist {
    padding-left: 1rem;
    border-left: 1px solid #dee2e6;
}

/* Main Content Adjustment */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Responsive Styles */
@media (max-width: 767.98px) {
    .menu-sidebar {
        width: 100%;
        max-width: 320px;
    }

    .menu-sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        width: 100%;
    }
}

/* RTL Support */
[dir="rtl"] .menu-sidebar {
    border-right: none;
    border-left: 1px solid #dee2e6;
}

[dir="rtl"] .menu-category-content {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .menu-link-item {
    padding-left: 1rem;
    padding-right: 2.5rem;
}

[dir="rtl"] .menu-sublist {
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 1px solid #dee2e6;
}

/* Icon Picker Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
}

.icon-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-item:hover {
    background-color: #e9ecef;
    transform: scale(1.05);
}

/* Menu Management Styles */
.menu-management-tree {
    padding: 1rem;
}

.category-item {
    margin-bottom: 1rem;
}

/* Sortable Headers */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-indicator {
    margin-left: 0.5rem;
}

/* Column Visibility Toggle */
.column-toggle {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.column-toggle:hover {
    opacity: 1;
}