@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-MediumItalic.ttf')
    format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-SemiBoldItalic.ttf')
    format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Optional: Light, ExtraLight, ExtraBold, etc. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/static/fonts/PlusJakartaSans/static/PlusJakartaSans-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Parent class for scoping (HMX CSS convention) */
.hx-database-manager {
  background-color: #ffffff;
  padding: 20px;
  color: #333;
}

/* Reset and base styles */
.hx-database-manager * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Logo styling */
.hx-database-manager #company_logo {
  display: block;
  margin: 40px auto 24px;
  width: 300px;
  height: auto;
}

.container {
  display: flex;
  flex-direction: column;
  margin: 0 auto 40px;
  padding: 24px;
  gap: 16px;
  max-width: 1280px;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
}

.section {
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid #e6e6e6;
  overflow: hidden;
}

/* Section headers */
.section-header {
  background-color: #d9d9d9;
  border-bottom: 1px solid #e6e6e6;
  padding: 6px;
  display: flex;
  align-items: center;
}

.header-label-l,
.header-label-r {
  display: flex;
  flex-grow: 1;
  padding: 8px 12px;
  gap: 2px;
  color: #1e1e1e;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
}

.header-label-l .header-label-r {
  display: flex;
  flex-grow: 1;
}

.header-label-r {
  justify-content: center;
  max-width: 500px;
}

.section-form {
  padding: 6px;
}

.form-row {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.form-col {
  display: flex;
  flex-grow: 1;
  padding: 8px 12px;
  gap: 6px;
}

.form-col-thin {
  display: flex;
  flex-grow: 1;
  padding: 8px 12px 0px;
  gap: 6px;
}

.max-width-655 {
  max-width: 655px;
}

.max-width-500 {
  max-width: 500px;
}

.max-width-367 {
  max-width: 367px;
}

.subtext {
  display: none;
  margin: 8px 0;
  color: #4a9eff;
}

.subtext-error {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;

  padding: 4px;
  color: #ff4a4a;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;

  /* text */
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
}

.no-gap {
  gap: 0;
  flex-direction: column;
}

.input-text {
  width: 100%;
  padding: 8px 12px;
  gap: 8px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;

  /* Body/Body 1/Regular */
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #757575;
}

/* Buttons */
button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;

  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;

  border: none;
  border-radius: 8px;
  cursor: pointer;

  transition: background-color 0.2s;
}

.top-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.top-button {
  display: flex;
  align-items: center;
  width: 200px;
}

.grow-btn {
  flex-grow: 1;
}

.primary-btn {
  background: linear-gradient(90deg, #5599f2 40%, #3082ed 100%);
  color: #fff;
  border: none;
}

.neutral-btn {
  background-color: #f5f5f5;
  color: #1e1e1e;
  border: 1px solid #e6e6e6;
}

.danger-btn {
  background-color: #d9534f;
  color: #fff;
}

.danger-btn:hover {
  background-color: #d04b58;
}

/* Radio buttons */
input[type='radio'] {
  accent-color: #3082ed;
  width: 22px;
  height: 22px;
}

/* Progress bars */
.progress-wrapper {
  margin-top: 10px;
}

.progress-container {
  /* margin-top: 10px; */
  width: 100%;
  background-color: #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 20px;
  background-color: #4a9eff;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 5px;
  font-size: 14px;
}

/* Icon styles */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
}

/* Link styles */
.no-file {
  color: #6c757d;
  font-style: italic;
}

.file-name-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #b3b3b3;
}

.freeze-management {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  text-decoration-line: underline;
  color: #3082ed;
}

.source-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #b3b3b3;
}

/* Form elements */
.select {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  height: 40px;
  outline: none;

  /* text */
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;

  /* arrow-down */
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 24px;
  padding-right: 30px;
}

.disabled {
  pointer-events: none;
  opacity: 0.6;
}

button:active:not(.disabled) {
  transform: scale(0.98);
}

.primary-btn:hover {
  background: linear-gradient(90deg, #408aef 40%, #2578e0 100%);
}

.neutral-btn:hover {
  background-color: #eeeeee;
}

.neutral-btn:active,
.primary-btn:active,
.danger-btn:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select:hover {
  border-color: #000000;
  cursor: pointer;
}

.input-text:hover {
  border-color: #000000;
  cursor: text;
}

@media (max-width: 768px) {
  button,
  .select,
  input[type='text'] {
    height: 60px;
  }

  .container {
    padding: 0px;
    margin: 0 12px 72px;
    gap: 36px;
    border: none;
  }

  .section-form {
    padding: 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 16px;
  }

  #restore-db {
    margin-top: 16px;
  }

  .freeze-management {
    margin-bottom: 16px;
  }

  .top-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .top-button {
    width: 100%;
  }

  .form-col,
  .form-col-thin {
    padding: 0;
  }

  .header-label-l {
    font-size: 16px;
    line-height: 20px;
    padding: 6px 8px;
  }

  .header-label-r {
    display: none;
  }

  .max-width-655,
  .max-width-500,
  .max-width-367 {
    max-width: 100%;
  }

  #company_logo {
    width: 300px;
    margin: 24px auto;
  }
}

.form-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top: 4px solid #007bff; /* Blue spinner */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

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

#create-db-modal.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

#create-db-modal.modal.show {
  display: flex;
}

#create-db-modal .modal-content {
  font-family: 'Plus Jakarta Sans', sans-serif;
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#create-db-modal .modal-content input,
#create-db-modal .modal-content select,
#create-db-modal .modal-content button {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#create-db-modal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

#create-db-modal .modal-content input,
#create-db-modal .modal-content select {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#create-db-modal .modal-content button {
  width: 100%;
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
}

#create-db-modal .modal-content button:hover {
  background-color: #0b5ed7;
}

#create-db-modal .modal-content .close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 1.25rem;
  cursor: pointer;
  color: #888;
}

/* Freeze Database Modal */
#freeze-db-modal.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

#freeze-db-modal .modal-content.freeze-modal-content {
  font-family: 'Plus Jakarta Sans', sans-serif;
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-height: 80vh;
  overflow-y: auto;
}

#freeze-db-modal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: #1e1e1e;
}

#freeze-db-modal .modal-content .close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 1.25rem;
  cursor: pointer;
  color: #888;
}

#freeze-db-modal .modal-content .close:hover {
  color: #333;
}

.freeze-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
  align-items: center;
}

.freeze-select {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #fff;
}

.freeze-btn {
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
}

.freeze-table-container {
  margin-top: 1rem;
}

.freeze-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.freeze-table th,
.freeze-table td {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid #e6e6e6;
}

.freeze-table th {
  background-color: #f4f4f4;
  font-weight: 600;
  color: #1e1e1e;
}

.freeze-table tbody tr:hover {
  background-color: #f9f9f9;
}

.freeze-table .no-data {
  color: #888;
  font-style: italic;
}
