/* ---------- Global options ----------*/
/* Set Helvetica as global font */
body {
  font-family: "Helvetica", "Arial", sans-serif !important;
}

/* Force Helvetica in bs4Dash selectInput elements */
.selectize-input,
.selectize-dropdown,
.selectize-input input {
  font-family: Helvetica, Arial, sans-serif !important;
  font-size: 15px !important;
}

/* Target the label above slider */
.slider-label, .form-group > label {
  font-family: Helvetica, Arial, sans-serif !important;
}

/* Target the range slider elements */
.irs, 
.irs-line, 
.irs-bar, 
.irs-grid-text, 
.irs-single, 
.irs-min, 
.irs-max, 
.irs-from, 
.irs-to {
  font-family: Helvetica, Arial, sans-serif !important;
}

/* Set bs4Dash value box text styles */
.small-box .inner h3,
.small-box .inner p {
  font-family: Helvetica, Arial, sans-serif !important;
  font-size: 16px !important;
}

/* Ensure the container uses Helvetica too */
.small-box .inner {
  font-family: Helvetica, Arial, sans-serif !important;
} 

/* ---------- Specific elements ----------*/
/*  -- Home page -- */
.home-dash-title {
  font-size: 18px;
  margin-left: 10px;
  font-weight: 500;
}

/* Bs4 box for WHO goals graphic */
.who-bs4-box {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px;
}

/* Bs4 box for elimination graphic */
.elim-bs4-box {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mod_01_home_details_footer {
  text-align: left;  
  padding: 15px 20px;
  background-color: #ffffff;  
  margin-top: 20px;
  border-top: 1px solid #000; 
  color: #000;
  font-size: 14px;
  line-height: 1.5;
}

/*  -- Study details page -- */
.study-detail-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
}
 
.study-detail-btn {
  background: linear-gradient(135deg, #667eea 0%, #605ca8 100%);
  border: none;
  border-radius: 25px;
  color: white;
  padding: 8px 20px;
  font-size: 0.9em;
  transition: all 0.3s ease;
}
 
.study-detail-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
 
.study-detail-label {
  font-weight: 600;
  color: #495057;
  display: inline-block;
  width: 150px;
}

.study-detail-cover-img {
  display:    block;
  margin:     0 auto 30px;
  max-width:  100%;
  height:     auto;
  max-height: 100px;    
}

@media (max-width: 992px) {
  .study-details-row .col-sm-4 {
    -webkit-flex: 0 0 50%;
    -ms-flex:     0 0 50%;
    flex:         0 0 50%;
    max-width:    50%;
  }
}

/*  -- Data page -- */
.data-pie-bs4-box{
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 400px;
}

/*  -- Map page -- */
.map-small-dropdown .selectize-input,
.map-small-dropdown .selectize-dropdown,
.map-small-dropdown .selectize-input input {
  font-size: 15px !important; 
}

.map-main-panel {
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
  border: 0.5px solid black;
}

.map-small-dropdown-text {
  font-size: 14px !important;
}

.map-legend-outer-border {
  padding: 10px !important;
  margin: 0 !important;
}


/*  -- Dashboard details page -- */
.data-detail-var-list {
  padding-left: 25px;
}

/* -- Global adjustment for different size screens -- */
@media (max-width: 768px) {

  /* Study details: 1 per row */
  .study-details-row .col-sm-4 {
    -webkit-flex: 0 0 100%;
    -ms-flex:     0 0 100%;
    flex:         0 0 100%;
    max-width:    100%;
  }

  /* Home value boxes: stack */
  .home-valuebox-row .col-sm-4 {
    -webkit-flex: 0 0 100%;
    -ms-flex:     0 0 100%;
    flex:         0 0 100%;
    max-width:    100%;
  }

  /* 2-column card rows (home infographics + data page): stack */
  .home-infographic-row .col-sm-6,
  .data-charts-row      .col-sm-6 {
    -webkit-flex: 0 0 100%;
    -ms-flex:     0 0 100%;
    flex:         0 0 100%;
    max-width:    100%;
  }

  /* Map overlay panel: full width, anchored to bottom of viewport */
  .map-main-panel {
    width:  calc(100vw - 20px) !important;
    right:  10px !important;
    left:   10px !important;
    top:    auto !important;
    bottom: 10px !important;
    height: auto !important;
  }
}
/* ---------- Authentication overlay ---------- */
/* Full-screen container shown before login (see app_ui.R / app_server.R). */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #f4f6f9;
  padding: 1rem;
}

.auth-brand {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2D3184;
  text-align: center;
}

/* shinyauthr renders its own card; keep a consistent width with our panels. */
.auth-overlay .shiny-input-container,
.auth-overlay .panel,
.auth-card {
  width: 100%;
  max-width: 360px;
}

.auth-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.auth-card h3 {
  margin-top: 0;
  color: #2D3184;
}

.auth-intro {
  margin-bottom: 1rem;
  color: #555;
}

.auth-msg,
.auth-error,
.auth-success {
  font-size: 0.9rem;
}

.auth-error   { color: #b00020; }
.auth-success { color: #0a7a3f; }

/* ---------- shinyauthr login card ---------- */
/* shinyauthr sets an inline width:500px on its panel; narrow + keep centered. */
#login-panel {
  width: 360px !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

#login-panel .well {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 1.75rem 2rem 2rem;
}

/* Breathing room under the "Sign in" heading. */
#login-panel .well > h2,
#login-panel .well > h3,
#login-panel .well > .h2,
#login-panel .well > .h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Keep the field labels/inputs left-aligned within the centered card, and add
   vertical spacing between each field group. */
#login-panel .shiny-input-container,
#login-panel .form-group {
  text-align: left;
  width: 100%;
  margin-bottom: 1.25rem;
}

#login-panel label {
  margin-bottom: 0.4rem;
}

/* The login button had near-invisible text; force readable contrast. */
#login-button {
  color: #ffffff !important;
  background-color: #2D3184 !important;
  border-color: #2D3184 !important;
  margin-top: 0.75rem;
  padding: 0.45rem 1.75rem;
}
#login-button:hover,
#login-button:focus {
  color: #ffffff !important;
  background-color: #24276a !important;
  border-color: #24276a !important;
}

/* ---------- Sidebar logout button ---------- */
.sidebar-logout-wrap {
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-logout-btn {
  width: 100%;
  color: #ffffff !important;
  background-color: #2D3184 !important;
  border-color: #2D3184 !important;
  text-align: left;
}
.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus {
  color: #ffffff !important;
  background-color: #24276a !important;
  border-color: #24276a !important;
}
.sidebar-logout-btn .fa,
.sidebar-logout-btn .fas {
  margin-right: 0.5rem;
}

/* "Forgot password?" link under the login card. */
.auth-forgot {
  text-align: center;
  margin-top: 0.85rem;
}
.auth-forgot a {
  color: #2D3184;
  font-size: 0.9rem;
}
.auth-forgot a:hover {
  text-decoration: underline;
}

/* Authorized users table: scroll within its box on narrow screens. */
.users-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.users-table-wrap table {
  width: 100%;
  margin-bottom: 0;
}
.users-table-wrap th,
.users-table-wrap td {
  white-space: nowrap;
}

/* Modals (e.g. "Forgot password?") must sit above the pre-login auth overlay
   (z-index: 2000), otherwise they open behind it and appear to do nothing. */
.modal { z-index: 2100 !important; }
.modal-backdrop { z-index: 2090 !important; }

/* Password-requirements hint on the set-password page. */
.auth-req {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* Show/hide password eye toggle (see fct_password_input). */
.password-eye-wrap {
  margin-bottom: 1rem;
}
.password-eye-inner {
  position: relative;
}
.password-eye-inner .form-group,
.password-eye-inner .shiny-input-container {
  margin-bottom: 0;
}
.password-eye-inner .form-control {
  padding-right: 38px;
}
.password-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
}
.password-eye:hover {
  color: #2D3184;
}
