/* ---------- BASE STYLES ---------- */
body {
  font-family: 'Inter', sans-serif;
  background-color: #1e1f23;
  color: #f1f3f5;
  font-size: 1.05rem;
  line-height: 1.6;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 80px;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

.hero-section {
  background: linear-gradient(135deg, #005f73 0%, #0a9396 100%);
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.card {
  background-color: #2b2e34;
  border: 1px solid #3a3d44;
  color: #f1f3f5;
  border-radius: 0.5rem;
}

.card-body {
  padding: 1.5rem;
  color: #f1f3f5;
}

h1, h2, h4, h5 {
  letter-spacing: 0.5px;
  color: #ffffff;
}

/* ---------- DOWNLOAD BUTTON ---------- */
#downloadBtn {
  position: fixed;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #f8f9fa;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
}

#downloadBtn:hover {
  color: #4bc0c8;
}

/* ---------- RESPONSIVE STYLES ---------- */
@media (max-width: 768px) {
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    padding: 0.5rem !important;
    margin-bottom: 1rem;
    background-color: #343a40;
    font-size: 0.9rem;
  }

  .sidebar h5 {
    font-size: 1rem;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
  }

  .card-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ---------- PRINT STYLES ---------- */
@media print {
  body {
    width: 100%;
    margin: 0 auto;
  }

  .container {
    max-width: 100% !important;
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .card {
    width: 95% !important;
    margin: auto;
    padding: 10px !important;
    background-color: white;
    color: black;
  }

  .card-body {
    padding: 10px !important;
  }

  .plotly-graph-div {
    width: 100% !important;
    max-width: 100% !important;
    height: 400px !important;
    overflow: hidden;
  }

  table {
    page-break-inside: avoid;
  }
}

/* ---------- PLOTLY SCROLL FIX ---------- */
@media (max-width: 768px) {
  .plot-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .plot-container {
    min-width: 100%;
    max-width: 100%;
  }
  .plot-container .plotly-graph-div,
  .plot-container .main-svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .plot-wrapper::before,
  .plot-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 20px;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
  }
  .plot-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(30,31,35,0.9), rgba(30,31,35,0));
    opacity: 0;
  }
  .plot-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(30,31,35,0.9), rgba(30,31,35,0));
    opacity: 0;
  }
  .plot-wrapper.scroll-left::before {
    opacity: 1;
  }
  .plot-wrapper.scroll-right::after {
    opacity: 1;
  }
}

/* ---------- UTILITY CLASSES ---------- */
.scroll-to-top-center {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  text-align: center;
  background-color: #4bc0c8;
  color: #1a1a1a;
  border: 1px solid #3bb3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.scroll-to-top-center:hover {
  background-color: #3bb3b8;
}

.form-control-sm {
  font-size: 0.9rem;
  padding: 0.375rem 0.75rem;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.375rem 0.75rem;
}

/* ---------- MISC FIXES ---------- */
.tab-content {
  padding-top: 20px;
}

.sidebar {
  position: sticky;
  top: 10px;
  height: 100vh;
  overflow-y: auto;
}

.plot-container {
  width: 100%;
  min-height: 300px;
}
