/* Enhanced UI Elements */
.info-box {
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}
.info-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.info-box-content {
  padding: 15px;
}
.info-box-number {
  font-size: 1.5em;
  font-weight: bold;
}

/* Box Styling */
.box {
  transition: all 0.3s ease;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.box:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Progress Bars */
.progress {
  height: 25px !important;
  border-radius: 15px;
  background-color: #f5f5f5;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  overflow: hidden;
}
.progress-bar {
  line-height: 25px !important;
  font-size: 14px !important;
  transition: width 0.6s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .box {margin-bottom: 10px;}
  .info-box {margin-bottom: 10px;}
  .content {padding: 10px;}
  .plot-container.mobile {
    padding: 10px;
    margin: 5px;
  }
  .info-box.mobile {
    margin: 5px 0;
  }
  .help-tooltip {
    bottom: 60px !important;
  }
  #download-container {
    flex-direction: column;
    gap: 5px;
  }
}

/* Enhanced Accessibility */
.btn:focus {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}
[role='button']:focus,
[role='tab']:focus {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  body {
    background: white !important;
    color: black !important;
  }
  .btn {
    border: 2px solid currentColor;
  }
  .plot-container {
    border: 2px solid #666;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Plot Aesthetics */
.plot-container {
  background: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
}
.plot-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  transition: background-color 0.3s;
}
.plot-container:hover::after {
  background-color: rgba(255,255,255,0.1);
}

/* Loading Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading-spinner.animate {
  animation: spin 1s linear infinite;
}
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Enhanced Help Dialog */
.help-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 15px;
  max-width: 300px;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.help-content.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Improved Notifications */
.shiny-notification {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 12px 15px;
  margin: 5px;
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.3s forwards;
}
@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Print Styles */
@media print {
  .sidebar-menu,
  .help-tooltip,
  #download-container {
    display: none !important;
  }
  .content-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }
  .plot-container {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Color Indicators */
.green {color:#008548;}
.red {color:#b13c2e;}
.grey {color:grey;}

/* Layout */
.content-wrapper {background-color: #f4f6f9;}
.nav-tabs-custom {box-shadow: 0 2px 5px rgba(0,0,0,0.1);}
.skin-black .main-header .logo:hover {background-color: #222d32;}
