html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  padding-bottom: 100px; /* Height of footer */
}

.wrapper {
  min-height: calc(100vh - 100px);
}

.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;
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  padding: 1rem 0;
  z-index: 10;
}

.footer a {
  transition: color 0.2s ease-in-out;
}

.footer a:hover {
  color: #0d6efd !important;
}

.footer .text-primary {
  color: #0d6efd !important;
}

/* Ensure proper spacing for content */
.container-fluid {
  padding-bottom: 1rem;
}

/* Ensure wrapper takes full available space minus footer */
.wrapper {
  position: relative;
  z-index: 1;
}

/* Add extra spacing for pages that might be short */
main[role="main"] {
  min-height: 400px;
}

/* Remove sticky positioning that was causing overlap */

/* Uptime History Bar Styles */
.uptime-history {
  display: flex;
  align-items: center;
  gap: 1px;
  min-height: 20px;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* Prevent scrollbars */
  box-sizing: border-box;
}

.uptime-history.compact {
  gap: 1px;
}

.uptime-bar {
  height: 20px;
  min-width: 2px; /* Reduced minimum width for 100-day timeline */
  max-width: 20px; /* Prevent bars from getting too wide */
  flex: 1 1 auto; /* Allow shrinking and growing */
  border-radius: 2px;
  transition: all 0.2s ease;
  cursor: pointer;
  /* Ensure no default background */
  background-color: #e5e7eb !important; /* Default fallback color */
  box-sizing: border-box;
}

.uptime-bar:hover {
  transform: scaleY(1.2);
  filter: brightness(1.1);
}

/* Detailed Uptime Color System - with higher specificity */
.uptime-history .uptime-bar.uptime-up,
.uptime-bar.uptime-up {
  background-color: #10b981 !important; /* Green - Perfect (0% downtime) */
}

.uptime-history .uptime-bar.uptime-warning-light,
.uptime-bar.uptime-warning-light {
  background-color: #f59e0b !important; /* Yellow - Good (<0.5% downtime) */
}

.uptime-history .uptime-bar.uptime-warning,
.uptime-bar.uptime-warning {
  background-color: #f97316 !important; /* Orange - Fair (0.5-5% downtime) */
}

.uptime-history .uptime-bar.uptime-down,
.uptime-bar.uptime-down {
  background-color: #ef4444 !important; /* Red - Poor (>5% downtime) */
}

.uptime-history .uptime-bar.uptime-partial,
.uptime-bar.uptime-partial {
  background-color: #f59e0b !important; /* Yellow - fallback for partial */
}

.uptime-history .uptime-bar.uptime-nodata,
.uptime-bar.uptime-nodata {
  background-color: #e5e7eb !important; /* Light gray for no data */
}

/* Legacy support for old color names - with higher specificity */
.uptime-history .uptime-bar.uptime-success,
.uptime-bar.uptime-success { 
  background-color: #10b981 !important; 
}

.uptime-history .uptime-bar.uptime-danger,
.uptime-bar.uptime-danger { 
  background-color: #ef4444 !important; 
}

/* Fancy Tooltip Styles */
.fancy-tooltip-trigger {
  cursor: pointer;
  transition: all 0.2s ease;
}

.fancy-tooltip-trigger:hover {
  transform: scaleY(1.2);
  filter: brightness(1.1);
}

.fancy-tooltip {
  position: fixed;
  z-index: 10000;
  background: rgba(30, 35, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  max-width: 280px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(20px);
  color: white;
  font-size: 0.875rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.fancy-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fancy-tooltip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px 12px 0 0;
}

.tooltip-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.tooltip-body {
  padding: 16px 18px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(102, 126, 234, 0.4);
}

.tooltip-row:last-of-type {
  margin-bottom: 16px;
}

.tooltip-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 500;
}

.tooltip-value {
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

.tooltip-metrics {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.metric-item.success {
  color: #10b981;
}

.metric-item.failed {
  color: #ef4444;
}

/* Uptime legend indicators */
.uptime-legend-up, .uptime-legend-down, .uptime-legend-nodata {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 2px;
}

.uptime-legend-up {
  background-color: #28a745;
}

.uptime-legend-down {
  background-color: #dc3545;
}

.uptime-legend-nodata {
  background-color: #6c757d;
}

/* Modern User Dropdown Styles */
.user-avatar {
  color: #6c757d;
  transition: color 0.2s ease;
}

.nav-link:hover .user-avatar {
  color: #495057;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  min-width: 200px;
  z-index: 999999 !important;
  position: absolute !important;
}

.dropdown-header {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  margin: 0.125rem 0.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #212529;
}

.dropdown-item.text-danger:hover {
  background-color: #f8d7da;
  color: #721c24;
}

.dropdown-divider {
  margin: 0.5rem 0;
}

/* Responsive user dropdown */
@media (max-width: 768px) {
  .dropdown-menu {
    min-width: 180px;
  }
  
  .user-avatar {
    margin-right: 0.5rem !important;
  }
}

/* Modern button styling for login/register */
.nav-link i {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav-link:hover i {
  opacity: 1;
}

/* Additional dropdown z-index fixes */
.navbar {
  z-index: 1000 !important;
  position: relative !important;
}

.navbar-nav .nav-item.dropdown {
  z-index: 999998 !important;
}

.dropdown-toggle {
  z-index: 999997 !important;
  position: relative !important;
}

/* Ensure Identity page layouts remain intact */
.manage-container {
  padding: 2rem 0 !important;
  min-height: calc(100vh - 200px) !important;
}

.manage-container .row {
  display: flex !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
}

.manage-container .col-lg-3,
.manage-container .col-lg-9 {
  flex: 0 0 auto !important;
}

.page-container.identity-layout {
  background: transparent !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: auto !important;
}

.manage-wrapper {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  border-radius: 24px !important;
  margin: 2rem !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Force Bootstrap column layout to work properly */
@media (min-width: 992px) {
  .manage-container .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .manage-container .col-lg-3 {
    flex: 0 0 280px !important;
    max-width: 280px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .manage-container .col-lg-9 {
    flex: 1 !important;
    max-width: calc(100% - 280px) !important;
    padding-left: 1rem !important;
    padding-right: 0 !important;
  }
}

/* Fix content cards to not exceed container width */
.manage-content-card {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Force flexbox layout for manage pages */
.manage-layout {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

.manage-sidebar {
  flex: 0 0 300px !important;
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
}

.manage-main {
  flex: 1 !important;
  width: calc(100% - 300px) !important;
  min-width: 0 !important;
}

/* Responsive fixes for Identity pages */
@media (max-width: 991px) {
  .manage-container .row {
    flex-wrap: wrap !important;
  }
  
  .manage-container .col-lg-3,
  .manage-container .col-lg-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .manage-container .col-lg-3 {
    margin-bottom: 1rem !important;
  }
  
  .manage-layout {
    flex-direction: column !important;
  }
  
  .manage-sidebar {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    max-height: none !important;
    position: static !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5) !important;
  }
  
  .manage-main {
    width: 100% !important;
  }
}