/* Custom CSS for BMD Data Portal */

/* Global Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* Header Styles */
.header-container {
  width: 90%;
  margin: 0 auto;
}

.header-logo {
  width: 100%;
  height: auto;
}

.navbar {
  background-color: #6c757d;
  height: 40px;
  padding: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-link {
  color: #212529;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #f8f9fa;
}

/* Section Titles */
.section-title {
  color: #25376e;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 20px;
}

/* Required Fields */
.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* Notes */
.note {
  color: #c21ec2;
  font-weight: bold;
  font-size: 16px;
}

/* Price Breakdown */
.price-breakdown {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  font-weight: 600;
}

/* Table Styles */
.table-custom th {
  background-color: #6c757d;
  border: 1px solid #495057;
  padding: 8px;
  color: white;
}

.table-custom td {
  border: 1px solid #495057;
  padding: 8px;
}

/* Custom Buttons */
.btn-custom {
  background-color: #0d6efd;
  color: white;
  font-weight: 600;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.btn-custom:hover {
  background-color: #0b5ed7;
  color: white;
}

/* Modal Custom Styles */
.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
  border-color: #25376e;
  box-shadow: 0 0 0 0.25rem #25376e;
}

/* Select All Option */
.select-all-option {
  font-weight: bold;
  color: #0d6efd !important;
}

/* Payment Gateway Image */
.payment-gateway-img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  margin: 15px 0;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 10px;
}

/* Help Table */
.help-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.help-table tr:nth-child(odd) {
  background-color: #e9ecef;
}

.help-table td {
  padding: 12px;
}

/* Footer */
footer {
  border-top: 1px solid #212529;
}

.footer-text {
  font-weight: 600;
  font-size: 14px;
}

/* Login Page */
.min-vh-100 {
  min-height: 100vh;
}

/* Success/Cancel Pages */
.success-icon,
.cancel-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Admin Dashboard */
.section-content {
  display: block;
}

.section-content.d-none {
  display: none !important;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    width: 95%;
  }

  .navbar {
    height: auto;
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .price-breakdown {
    font-size: 14px;
  }

  .table-custom {
    font-size: 14px;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background-color: white !important;
  }

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

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Toast Customization */
.Toastify__toast {
  border-radius: 5px;
}

.Toastify__toast--success {
  background-color: #198754;
}

.Toastify__toast--error {
  background-color: #dc3545;
}

.Toastify__toast--warning {
  background-color: #ffc107;
  color: #212529;
}

.Toastify__toast--info {
  background-color: #0dcaf0;
}

/* Select Picker Customization */
.bootstrap-select .dropdown-toggle:focus {
  outline: none !important;
  box-shadow: 0 0 0 0.25rem rgba(194, 30, 194, 0.25) !important;
}

/* Datepicker Customization */
.datepicker {
  z-index: 1051 !important;
}

.datepicker table tr td.active.active {
  background-color: #c21ec2 !important;
  border-color: #c21ec2 !important;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Inline CSS for immediate fixes */
body {
  background-color: #f8f9fa;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.header-container {
  width: 90%;
  margin: 0 auto;
}

.header-logo {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.navbar-custom {
  background-color: #00407a !important;
  height: 40px;
  padding: 8px 15px;
  font-weight: 600;
  align-items: center;
  gap: 20px;
}

.nav-link-custom {
  color: #ffffff !important;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-link-custom:hover {
  color: #a9c7e6 !important;
}

.required-field::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

.note-text {
  color: #f03131;
  font-weight: bold;
  font-size: 14px;
  margin: 10px 0;
}

.form-control,
.form-select {
  border-radius: 5px !important;
  border: 1px solid #6c757d !important;
}

.form-control:focus,
.form-select:focus {
  border-color: #25376e !important;
  box-shadow: 0 0 0 0.25rem #25376e4d !important;
}

.btn-primary {
  background-color: #25376e !important;
  border-color: #496dd8 !important;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #071a52 !important;
  border-color: #07206d !important;
}

.price-breakdown {
  background-color: #e9ecef;
  padding: 10px 15px;
  border-radius: 5px;
  border-left: 4px solid #c21ec2;
  font-weight: 600;
}

/* Date picker input styling */

/* Completely hide disabled dates */
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
  display: none !important;
}

/* Fix row height collapse */
.datepicker table tr {
  height: auto;
}

.datepicker-input {
  background-color: white !important;
  cursor: pointer !important;
}

.datepicker-input:hover {
  background-color: #f8f9fa !important;
}

/* jQuery UI Datepicker custom styling */
.ui-datepicker {
  background: white;
  border: 1px solid #c21ec2;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 10px;
  z-index: 1000 !important;
}

.ui-datepicker-header {
  background: #c21ec2;
  color: white;
  border: none;
  border-radius: 3px 3px 0 0;
  padding: 5px;
}

.ui-datepicker-title {
  font-weight: bold;
}

.ui-datepicker-prev,
.ui-datepicker-next {
  cursor: pointer;
  color: white;
}

.ui-datepicker-calendar th {
  background: #f8f9fa;
  color: #333;
  font-weight: bold;
  padding: 5px;
}

.ui-datepicker-calendar td {
  padding: 3px;
}

.ui-state-default {
  border: 1px solid #ddd;
  background: white;
  color: #333;
  text-align: center;
  padding: 5px;
  border-radius: 3px;
}

.ui-state-default:hover {
  background: #c21ec2;
  color: white;
  border-color: #c21ec2;
}

.ui-state-active {
  background: #c21ec2 !important;
  color: white !important;
  border-color: #c21ec2 !important;
}

.ui-state-highlight {
  background: #e9ecef;
  color: #333;
}

table.table-custom th {
  background-color: #6c757d;
  color: white;
  border: 1px solid #495057;
}

table.table-custom td {
  border: 1px solid #dee2e6;
}

.help-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.help-table tr:nth-child(odd) {
  background-color: #e9ecef;
}

footer {
  border-top: 2px solid #6c757d;
  background-color: #f8f9fa;
}

/* Fix for select picker */
.bootstrap-select .dropdown-toggle {
  border: 1px solid #6c757d !important;
  border-radius: 5px !important;
}

.input-group-text {
  background-color: #e9ecef;
  border: 1px solid #6c757d;
  cursor: pointer;
}

/* Calendar icon in date input */
.date-input-container {
  position: relative;
}

.date-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
}

/* Make sure all elements are visible */
* {
  box-sizing: border-box;
}

/* Login Page Specific */
.bg-gradient-primary {
  background: linear-gradient(135deg, #6a83cf, #25376e);
}

.card {
  border-radius: 1.25rem;
}

.input-group-text {
  background-color: #f1f3f5;
  border: 1px solid #25376e;
  border-right: none;
}

.form-control:focus {
  border-color: #25376e;
  box-shadow: 0 0 0 0.25rem #25376e;
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #2b4e72;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #333;
  font-weight: 500;
}

/* Chip/Tag styles for selected items */
.selected-chips-container {
  min-height: 40px;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 50rem;
}

.selected-chip .btn-close {
  padding: 0.25rem;
  margin-left: 0.25rem;
  opacity: 0.8;
}

.selected-chip .btn-close:hover {
  opacity: 1;
}

/* Small alert style */
.alert-sm {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 0;
}

.alert-sm .alert-heading {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* Price breakdown styles */
.price-summary {
  border: 1px solid #dee2e6;
}

.availability-warning {
  border-left: 4px solid #ffc107;
}

.availability-warning ul {
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
}

.availability-warning li {
  margin-bottom: 0.25rem;
}

/* Unavailable station in dropdown */
.option-item.unavailable-station label {
  color: #dc3545 !important;
  font-style: italic;
}

/* Unavailable selected chip */
.selected-chip.chip-unavailable {
  background-color: #dc3545 !important;
  color: white !important;
  border: 1px solid #a71d2a;
}

/* .option-item.station-partial {
  color: #ffc107 !important;
  font-weight: bold;
  font-style: italic;
} */

.option-item.station-partial label::after {
  content: " (partial)";
  font-size: 0.8em;
  opacity: 0.8;
}

.option-item.station-none {
  color: #dc3545 !important;
  font-weight: bold;
  /* text-decoration: line-through; */
  opacity: 0.7;
}

.option-item.station-none label::after {
  content: " (no data)";
  font-size: 0.8em;
  opacity: 0.8;
}

.selected-chip.chip-full {
  background-color: #0d6efd !important;
  color: #fff !important;
}

.selected-chip.chip-partial {
  background-color: #ffc107 !important;
  color: #ffffff !important;
  /* border: 1px solid #d39e00; */
}

.selected-chip.chip-none {
  background-color: #dc3545 !important;
  color: #ffffff !important;
  /* text-decoration: line-through; */
  opacity: 0.8;
}

/* Custom select with chips */
.custom-multiselect {
  position: relative;
}

.select-box {
  border: 1px solid #6c757d;
  border-radius: 5px;
  padding: 8px;
  min-height: 42px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.select-box .placeholder {
  color: #6c757d;
  padding: 2px 8px;
  /* Disable Bootstrap placeholder styles */
  display: inline !important;
  min-height: auto !important;
  vertical-align: baseline !important;
  cursor: pointer !important;
  background-color: transparent !important;
  opacity: 1 !important;
}

.select-box .selected-count {
  color: #0d6efd;
  font-weight: 500;
  padding: 2px 8px;
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #6c757d;
  border-radius: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 2px;
}

.select-options.show {
  display: block;
}

.option-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-item:hover {
  background: #f8f9fa;
}

.option-item.selected {
  background: #e7f1ff;
}

.option-checkbox {
  width: 18px;
  height: 18px;
}

.search-box {
  padding: 8px 12px;
  border-bottom: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.search-box input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

/* Custom chips */
.selected-chips-container {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background-color: transparent;
  display: none;
}

.selected-chips-container.has-chips {
  display: block;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
  margin-top: 8px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  background: #0d6efd;
  color: white;
  padding: 4px 10px;
  border-radius: 50rem;
  font-size: 14px;
  margin: 2px;
}

.selected-chip .remove-btn {
  background: none;
  border: none;
  color: white;
  margin-left: 6px;
  padding: 0 4px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .option-item.station-full {
  color: #0d6efd;
  font-weight: bold;
} */

/* .option-item.station-partial {
  color: #ffc107;
  font-weight: bold;
  font-style: italic;
} */

.option-item.station-none {
  color: #dc3545;
  font-weight: bold;
  /* text-decoration: line-through; */
  opacity: 0.7;
}

/* .selected-chip.chip-full {
            background-color: #198754 !important;
        } */

.selected-chip.chip-partial {
  background-color: #ffc107 !important;
  color: #ffffff !important;
}

.selected-chip.chip-none {
  background-color: #dc3545 !important;
  color: white !important;
  /* text-decoration: line-through; */
}

.selected-chip .remove-btn:hover {
  opacity: 1;
}

/* Counter */
.station-counter {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 5px;
}

/* Disabled state */
.custom-multiselect.disabled .select-box {
  background-color: #e9ecef;
  cursor: not-allowed;
  opacity: 0.6;
}

.custom-multiselect.disabled .select-box .placeholder {
  color: #6c757d;
}

/* Override Bootstrap placeholder styles globally */
.placeholder {
  /* Disable Bootstrap placeholder styles */
  display: inline !important;
  min-height: auto !important;
  vertical-align: baseline !important;
  cursor: default !important;
  background-color: transparent !important;
  opacity: 1 !important;
}

/* ===== STATION DROPDOWN COLORS - FORCED ===== */

/* Full data stations - Blue */
.option-item.station-full,
.option-item.station-full label {
  color: #0d6efd !important;
  font-weight: 600 !important;
}

/* Partial data stations - Yellow/Orange */
.option-item.station-partial,
.option-item.station-partial label {
  color: #fd7e14 !important;
  font-weight: 600 !important;
  font-style: italic !important;
}

/* No data stations - Red */
.option-item.station-none,
.option-item.station-none label {
  color: #dc3545 !important;
  font-weight: 600 !important;
  opacity: 0.9 !important;
}

/* Add indicators */
.option-item.station-partial label::after {
  content: " (partial)" !important;
  font-size: 0.8em !important;
  opacity: 0.8 !important;
  color: #fd7e14 !important;
}

.option-item.station-none label::after {
  content: " (no data)" !important;
  font-size: 0.8em !important;
  opacity: 0.8 !important;
  color: #dc3545 !important;
}

/* Hover effects */
.option-item.station-full:hover {
  background-color: rgba(13, 110, 253, 0.1) !important;
}

.option-item.station-partial:hover {
  background-color: rgba(253, 126, 20, 0.1) !important;
}

.option-item.station-none:hover {
  background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Payment button styles */
#payNowFromModal {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  padding: 12px 30px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

#payNowFromModal:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

#payNowFromModal i {
  margin-right: 8px;
}

.modal-footer {
  border-top: none;
}

.bg-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
}

/* Loading animation */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

#payNowFromModal {
  animation: pulse 2s infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hide when loaded */
.loaded .loader-overlay {
  opacity: 0;
  pointer-events: none;
}

/* Validation styles */
.is-invalid {
  border-color: #dc3545 !important;
}

.is-invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.validation-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: #6c757d;
}

/* Responsive fixes */
@media (max-width: 768px) {
  .header-container {
    width: 95%;
  }

  .navbar-custom {
    height: auto;
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ui-datepicker {
    width: 280px !important;
    left: 50% !important;
    transform: translateX(-50%);
  }
}
