/*
 * DDT Components CSS v1.0.0
 * Professional UI components library
 */

/* ========================================
   CARD COMPONENTS
   ======================================== */

.ddt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ddt-card-header {
  padding: 1rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem 0.375rem 0 0;
  font-weight: 600;
}

.ddt-card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.ddt-card-footer {
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0 0 0.375rem 0.375rem;
}

.ddt-card-title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.ddt-card-subtitle {
  margin-top: -0.375rem;
  margin-bottom: 0;
  color: #6c757d;
  font-size: 0.875rem;
}

.ddt-card-text {
  margin-bottom: 1rem;
}

.ddt-card-text:last-child {
  margin-bottom: 0;
}

.ddt-card-img {
  width: 100%;
  border-radius: 0.375rem 0.375rem 0 0;
}

.ddt-card-img-bottom {
  width: 100%;
  border-radius: 0 0 0.375rem 0.375rem;
}

.ddt-card-img-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.25rem;
  border-radius: 0.375rem;
}

/* Card variants */
.ddt-card-hover {
  transition: all 0.3s ease;
  cursor: pointer;
}

.ddt-card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.ddt-card-horizontal {
  flex-direction: row;
}

.ddt-card-horizontal .ddt-card-img {
  max-width: 200px;
  border-radius: 0.375rem 0 0 0.375rem;
}

/* ========================================
   BADGE COMPONENTS
   ======================================== */

.ddt-badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.ddt-badge-primary {
  color: #fff;
  background-color: #007bff;
}

.ddt-badge-secondary {
  color: #fff;
  background-color: #6c757d;
}

.ddt-badge-success {
  color: #fff;
  background-color: #28a745;
}

.ddt-badge-danger {
  color: #fff;
  background-color: #dc3545;
}

.ddt-badge-warning {
  color: #212529;
  background-color: #ffc107;
}

.ddt-badge-info {
  color: #fff;
  background-color: #17a2b8;
}

.ddt-badge-light {
  color: #212529;
  background-color: #f8f9fa;
}

.ddt-badge-dark {
  color: #fff;
  background-color: #343a40;
}

/* Badge pill */
.ddt-badge-pill {
  border-radius: 10rem;
}

/* Badge dot */
.ddt-badge-dot {
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Badge with icon */
.ddt-badge-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ========================================
   ALERT COMPONENTS
   ======================================== */

.ddt-alert {
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.ddt-alert-heading {
  color: inherit;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ddt-alert-link {
  font-weight: 600;
  text-decoration: underline;
}

.ddt-alert-dismissible {
  padding-right: 3rem;
}

.ddt-alert-close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1rem 1.25rem;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.ddt-alert-close:hover {
  opacity: 0.75;
}

/* Alert variants */
.ddt-alert-primary {
  color: #004085;
  background-color: #cce5ff;
  border-color: #b8daff;
}

.ddt-alert-secondary {
  color: #383d41;
  background-color: #e2e3e5;
  border-color: #d6d8db;
}

.ddt-alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.ddt-alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.ddt-alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.ddt-alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

.ddt-alert-light {
  color: #818182;
  background-color: #fefefe;
  border-color: #fdfdfe;
}

.ddt-alert-dark {
  color: #1b1e21;
  background-color: #d6d8d9;
  border-color: #c6c8ca;
}

/* ========================================
   MODAL COMPONENTS
   ======================================== */

.ddt-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.ddt-modal.ddt-show {
  display: block;
}

.ddt-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.15s linear;
}

.ddt-modal-overlay.ddt-show {
  opacity: 1;
}

.ddt-modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
}

.ddt-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  outline: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.ddt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.5rem 0.5rem 0 0;
}

.ddt-modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 1.25rem;
  font-weight: 600;
}

.ddt-modal-close {
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ddt-modal-close:hover {
  opacity: 0.75;
}

.ddt-modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1.25rem;
}

.ddt-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 0.5rem 0.5rem;
  gap: 0.5rem;
}

/* Modal sizes */
.ddt-modal-sm .ddt-modal-dialog {
  max-width: 300px;
}

.ddt-modal-lg .ddt-modal-dialog {
  max-width: 800px;
}

.ddt-modal-xl .ddt-modal-dialog {
  max-width: 1140px;
}

.ddt-modal-fullscreen .ddt-modal-dialog {
  max-width: 100%;
  margin: 0;
  height: 100%;
}

.ddt-modal-fullscreen .ddt-modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

/* Modal centered */
.ddt-modal-centered .ddt-modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

/* ========================================
   TOOLTIP COMPONENTS
   ======================================== */

.ddt-tooltip {
  position: absolute;
  z-index: 1070;
  display: block;
  margin: 0;
  font-size: 0.875rem;
  word-wrap: break-word;
  opacity: 0;
  transition: opacity 0.15s;
}

.ddt-tooltip.ddt-show {
  opacity: 0.9;
}

.ddt-tooltip-inner {
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  color: #fff;
  text-align: center;
  background-color: #000;
  border-radius: 0.375rem;
}

.ddt-tooltip-arrow {
  position: absolute;
  display: block;
  width: 0.8rem;
  height: 0.4rem;
}

.ddt-tooltip-arrow::before {
  position: absolute;
  content: "";
  border-color: transparent;
  border-style: solid;
}

/* Tooltip positions */
.ddt-tooltip-top {
  padding: 0.4rem 0;
}

.ddt-tooltip-top .ddt-tooltip-arrow {
  bottom: 0;
}

.ddt-tooltip-top .ddt-tooltip-arrow::before {
  top: -1px;
  border-width: 0.4rem 0.4rem 0;
  border-top-color: #000;
}

.ddt-tooltip-bottom {
  padding: 0.4rem 0;
}

.ddt-tooltip-bottom .ddt-tooltip-arrow {
  top: 0;
}

.ddt-tooltip-bottom .ddt-tooltip-arrow::before {
  bottom: -1px;
  border-width: 0 0.4rem 0.4rem;
  border-bottom-color: #000;
}

/* ========================================
   DROPDOWN COMPONENTS
   ======================================== */

.ddt-dropdown {
  position: relative;
  display: inline-block;
}

.ddt-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.ddt-dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.ddt-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.ddt-dropdown-menu.ddt-show {
  display: block;
}

.ddt-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  transition: all 0.15s;
}

.ddt-dropdown-item:hover,
.ddt-dropdown-item:focus {
  color: #16181b;
  background-color: #f8f9fa;
}

.ddt-dropdown-item.ddt-active {
  color: #fff;
  background-color: #007bff;
}

.ddt-dropdown-item:disabled {
  color: #6c757d;
  pointer-events: none;
  background-color: transparent;
}

.ddt-dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}

.ddt-dropdown-header {
  display: block;
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #6c757d;
  white-space: nowrap;
}

/* Dropdown positions */
.ddt-dropdown-menu-right {
  right: 0;
  left: auto;
}

.ddt-dropup .ddt-dropdown-menu {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.125rem;
}

/* ========================================
   BREADCRUMB COMPONENTS
   ======================================== */

.ddt-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  list-style: none;
  background-color: #e9ecef;
  border-radius: 0.375rem;
}

.ddt-breadcrumb-item {
  display: flex;
  align-items: center;
}

.ddt-breadcrumb-item + .ddt-breadcrumb-item {
  padding-left: 0.5rem;
}

.ddt-breadcrumb-item + .ddt-breadcrumb-item::before {
  display: inline-block;
  padding-right: 0.5rem;
  color: #6c757d;
  content: "/";
}

.ddt-breadcrumb-item.ddt-active {
  color: #6c757d;
}

/* ========================================
   PAGINATION COMPONENTS
   ======================================== */

.ddt-pagination,.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: 0.375rem;
  gap: 0.25rem;
}

.ddt-page-item,.pagination>li {
  display: inline-block;
}
 
.ddt-page-link, .pagination>li>a {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: #007bff;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.ddt-page-link:hover, .pagination>li>a:hover {
  z-index: 2;
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.ddt-page-link:focus,.pagination>li>a:focus {
  z-index: 3;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.ddt-page-item.ddt-active .ddt-page-link,.pagination>li>a.active {
  z-index: 3;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.ddt-page-item.ddt-disabled .ddt-page-link, .pagination>li>a.disabled {
  color: #6c757d;
  pointer-events: none;
  cursor: auto;
  background-color: #fff;
  border-color: #dee2e6;
  opacity: 0.6;
}

/* Pagination sizes */
.ddt-pagination-sm .ddt-page-link, .pagination-sm>li>a {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.ddt-pagination-lg .ddt-page-link, .pagination-lg>li>a {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* ========================================
   PROGRESS BAR COMPONENTS
   ======================================== */

.ddt-progress {
  display: flex;
  height: 1rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: #e9ecef;
  border-radius: 0.375rem;
  box-shadow: inset 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1);
}

.ddt-progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: #007bff;
  transition: width 0.6s ease;
}

.ddt-progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

.ddt-progress-bar-animated {
  animation: ddt-progress-bar-stripes 1s linear infinite;
}

@keyframes ddt-progress-bar-stripes {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Progress variants */
.ddt-progress-bar-success {
  background-color: #28a745;
}

.ddt-progress-bar-info {
  background-color: #17a2b8;
}

.ddt-progress-bar-warning {
  background-color: #ffc107;
}

.ddt-progress-bar-danger {
  background-color: #dc3545;
}

/* ========================================
   TABS COMPONENTS
   ======================================== */

.ddt-tabs {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  border-bottom: 1px solid #dee2e6;
}

.ddt-tab-item {
  margin-bottom: -1px;
}

.ddt-tab-link {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
  color: #007bff;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.ddt-tab-link:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  isolation: isolate;
}

.ddt-tab-link.ddt-active {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
}

.ddt-tab-link:disabled {
  color: #6c757d;
  pointer-events: none;
  background-color: transparent;
  border-color: transparent;
}

.ddt-tab-content {
  padding: 1rem;
}

.ddt-tab-pane {
  display: none;
}

.ddt-tab-pane.ddt-active {
  display: block;
}

/* ========================================
   ACCORDION COMPONENTS
   ======================================== */

.ddt-accordion {
  margin-bottom: 1rem;
}

.ddt-accordion-item {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
  margin-bottom: -1px;
}

.ddt-accordion-item:first-child {
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
}

.ddt-accordion-item:last-child {
  border-bottom-right-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
  margin-bottom: 0;
}

.ddt-accordion-header {
  margin-bottom: 0;
}

.ddt-accordion-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  background-color: #fff;
  border: 0;
  border-radius: 0;
  overflow-anchor: none;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.ddt-accordion-button:hover {
  background-color: #f8f9fa;
}

.ddt-accordion-button::after {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  content: "";
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: 1.25rem;
  transition: transform 0.2s ease-in-out;
}

.ddt-accordion-button.ddt-collapsed::after {
  transform: rotate(-180deg);
}

.ddt-accordion-collapse {
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.ddt-accordion-body {
  padding: 1rem 1.25rem;
}

/* ========================================
   SPINNER / LOADING COMPONENTS
   ======================================== */

.ddt-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ddt-spinner-border 0.75s linear infinite;
}

@keyframes ddt-spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.ddt-spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

.ddt-spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Spinner grow */
.ddt-spinner-grow {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  background-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: ddt-spinner-grow 0.75s linear infinite;
}

@keyframes ddt-spinner-grow {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* ========================================
   TOAST / NOTIFICATION COMPONENTS
   ======================================== */

.ddt-toast {
  max-width: 350px;
  overflow: hidden;
  font-size: 0.875rem;
  background-color: rgba(255, 255, 255, 0.95);
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  opacity: 0;
  transition: opacity 0.15s linear;
}

.ddt-toast.ddt-show {
  opacity: 1;
}

.ddt-toast-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: #6c757d;
  background-color: rgba(255, 255, 255, 0.85);
  background-clip: padding-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  border-top-left-radius: calc(0.375rem - 1px);
  border-top-right-radius: calc(0.375rem - 1px);
}

.ddt-toast-body {
  padding: 0.75rem;
}

.ddt-toast-close {
  margin-left: auto;
  margin-right: -0.375rem;
}

/* Toast container */
.ddt-toast-container {
  position: fixed;
  z-index: 1090;
  padding: 1rem;
  pointer-events: none;
}

.ddt-toast-container > .ddt-toast {
  pointer-events: auto;
  margin-bottom: 0.75rem;
}

/* Toast positions */
.ddt-toast-top-right {
  top: 0;
  right: 0;
}

.ddt-toast-top-left {
  top: 0;
  left: 0;
}

.ddt-toast-bottom-right {
  bottom: 0;
  right: 0;
}

.ddt-toast-bottom-left {
  bottom: 0;
  left: 0;
}

.ddt-toast-top-center {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.ddt-toast-bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}