/* ===================================================================
   COMPONENTS - Boxes, Buttons, Forms, Modals, Tabs
   =================================================================== */

/* -------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------- */
.h4,
h4 {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-dark) !important;
}

/* -------------------------------------------------------------------
   Box Styles
   ------------------------------------------------------------------- */
.box {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-top: none;
}

.box.box-primary {
  border-top: 3px solid var(--primary-light);
}

.box.box-success {
  border-top: 3px solid var(--accent-green);
}

.box.box-warning {
  border-top: 3px solid var(--accent-yellow);
}

.box-header {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  );
  color: white;
  border-radius: 8px 8px 0 0;
  padding: 15px;
}

.box-header .box-title {
  font-size: 18px;
  font-weight: 600;
}

.box-body {
  font-size: 16px;
}

.small-box {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  );
}

/* Box Spacing Consistency */
.tab-content .box {
  margin-bottom: 25px !important;
}

.multi-tab .box {
  border: none !important;
  box-shadow: none !important;
}

/* -------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */
#logout_btn {
  margin: auto !important;
}

.btn-primary {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
  border-radius: 6px;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0 auto;
  width: 100px;
  display: block;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 72, 106, 0.3);
}

.btn-success {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  border-radius: 6px;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 10px 5px;
}

.btn-warning {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  border-radius: 6px;
  color: var(--dark-gray);
}

/* Download Button Styling */
.box .btn-success {
  background-color: var(--accent-green) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.box .btn-success:hover {
  background-color: #36a23d !important;
  transform: translateY(-1px);
}

.box .btn-success:active {
  background-color: #2c8b33 !important;
  transform: translateY(0);
}

.box > div > .btn-success {
  margin-top: 5px;
  margin-right: 5px;
}

.box div[style*="justify-content: flex-end"] .btn-success {
  margin-left: 5px;
}

/* Reset Button */
.reset-btn {
  background: linear-gradient(135deg, var(--accent-yellow), #f39c12);
  border: none;
  color: var(--dark-gray);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 10px 5px;
}

.reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 182, 40, 0.3);
}

/* Quick Filter Buttons */
.quick-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-filter-btn {
  background-color: var(--primary-light);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  width: auto;
  display: inline-block;
}

.quick-filter-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 72, 106, 0.3);
  color: white;
}

.quick-filter-btn:focus,
.quick-filter-btn:active {
  background-color: var(--primary-dark);
  color: white;
}

/* -------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------- */
.form-control {
  border-radius: 6px;
  transition: border-color 0.3s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(46, 162, 220, 0.25);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  color: var(--primary-dark);
  font-weight: 500;
}

/* Date Range Input */
.input-daterange input:first-child {
  font-size: 14px;
}

.input-group .form-control:last-child {
  font-size: 14px;
}

.input-daterange .input-group-addon {
  font-size: 14px;
}

/* -------------------------------------------------------------------
   Modals
   ------------------------------------------------------------------- */
.modal-header {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  );
  color: white;
  border-radius: 8px 8px 0 0;
}

.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------- */
.tabbable {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.tabbable:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  transition: all 0.25s ease;
}

.nav-tabs > li > a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.nav-tabs > li.active > a {
  background-color: var(--primary-light) !important;
  color: white !important;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
}

.nav-tabs > li > a:hover {
  background-color: var(--primary-light);
  color: #fff !important;
}

.tab-content {
  margin-top: 15px !important;
}

.tab-content .box-header {
  background-color: var(--primary-light) !important;
  color: white !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 8px 15px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tab-content .box-body {
  margin-top: 10px !important;
  border: none !important;
  box-shadow: none !important;
}

.tab-pane {
  padding-top: 10px !important;
  padding-bottom: 15px !important;
}

/* -------------------------------------------------------------------
   Filters & Summary
   ------------------------------------------------------------------- */
.filter-section {
  background: white !important;
  border-radius: 8px;
  padding: 0px 4px;
}

.summary-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-gray);
  background: white;
  padding: 20px;
  border-radius: 8px;
}

/* -------------------------------------------------------------------
   Plots
   ------------------------------------------------------------------- */
.plot-container {
  /* background: var(--background-white); */
  /* border-radius: 12px; */
  /* padding: 20px; */
  /* box-shadow: 0 4px 15px var(--shadow-color); */
  /* border: 1px solid var(--border-light); */
  margin: 15px 0;
  position: relative;
  overflow: hidden;
}

.plotOutput,
.dataTableOutput {
  margin-top: 10px;
  margin-bottom: 15px;
  opacity: 0;
  animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------------------
   FAQ Styles
   ------------------------------------------------------------------- */
.faq-search-container {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  ) !important;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#faq_search {
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#faq_search:focus {
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.faq-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  width: 100%;
}

.faq-item {
  border-bottom: 1px solid #e9ecef;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  padding: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e8efff;
  transition: background 0.3s ease;
  font-size: 17px;
}

.faq-question:hover {
  background: var(--light-gray);
}

.fa-question-circle {
  color: #41af49;
  font-size: 16px;
}

.faq-answer {
  display: none;
  padding: 15px 20px 20px 46px;
  line-height: 1.6;
  color: #495057;
  background: #fafbff;
}

.no-results {
  text-align: center;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 12px;
}

/* -------------------------------------------------------------------
   Graph Builder (Esquisse)
   ------------------------------------------------------------------- */
.esquisse-title-container button.btn {
  display: inline;
  width: auto;
}

.esquisse-title {
  text-align: right;
  padding: 0px 50px 10px 0px;
}

/* -------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------- */
@media (max-width: 768px) {
  .box-header .box-title {
    font-size: 16px;
  }
}
