/* fixes styling issue with Bulma tables */
.table,
.table td,
.table th {
  color: black;
}

/* Page transition styles */
.htmx-swapping {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Button transition styles */
.button {
  transition: all 0.2s ease-in-out;
}

.htmx-request .button {
  position: relative;
  color: transparent !important;
}

.htmx-request .button::after {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: button-loading-spinner 0.75s infinite linear;
}

@keyframes button-loading-spinner {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive video container */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


/* Form loading overlay */
.has-form-overlay {
  position: relative;
}

.form-loading-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.form-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #dbdbdb;
  border-top-color: #3273dc; /* Bulma primary */
  border-radius: 50%;
  animation: form-loading-spin 0.8s linear infinite;
}

@keyframes form-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.modal.is-active {
  display: flex;
}

.modal-background {
  background-color: rgba(10, 10, 10, 0.86);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
}

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  margin: 0 auto;
  position: relative;
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1);
  z-index: 50;
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dbdbdb;
  background-color: #f5f5f5;
  border-radius: 6px 6px 0 0;
}

.modal-card-title {
  color: #363636;
  flex-grow: 1;
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.modal-card-body {
  flex-grow: 1;
  flex-shrink: 1;
  overflow-y: auto;
  padding: 1rem;
}

.modal-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid #dbdbdb;
  background-color: #f5f5f5;
  border-radius: 0 0 6px 6px;
}

.modal-card-foot .button:not(:last-child) {
  margin-right: 0.5rem;
}

.delete {
  background: none;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  display: inline-block;
  flex-grow: 0;
  flex-shrink: 0;
  font-size: 0;
  height: 20px;
  max-height: 20px;
  max-width: 20px;
  min-height: 20px;
  min-width: 20px;
  outline: none;
  position: relative;
  vertical-align: top;
  width: 20px;
}

.delete::before,
.delete::after {
  background-color: currentColor;
  content: "";
  display: block;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  transform-origin: center center;
}

.delete::before {
  height: 2px;
  width: 50%;
}

.delete::after {
  height: 50%;
  width: 2px;
}

.delete:hover {
  background-color: rgba(10, 10, 10, 0.3);
}

.delete:focus {
  background-color: rgba(10, 10, 10, 0.3);
}

.delete:active {
  background-color: rgba(10, 10, 10, 0.4);
}

/* Modal notification styles */
.modal .notification {
  margin-bottom: 0;
}

/* Modal spinner positioning */
.modal .field .control {
  position: relative;
}

.modal .htmx-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.modal .field.has-addons .control:first-child .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.modal .field.has-addons .control:last-child .button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}


