/* =========================================
   PROFILE BUILDER FORMS
========================================= */

/* Reset form list layout */
.wppb-user-forms ul,
.wppb-user-forms li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wppb-user-forms li {
  display: block !important;
  width: 100% !important;
  margin-bottom: 18px !important;
}

/* Main field labels */
.wppb-user-forms label,
.wppb-user-forms .wppb-form-field > label,
.wppb-user-forms .wppb-default-e-mail,
.wppb-user-forms .wppb-default-first-name,
.wppb-user-forms .wppb-default-last-name,
.wppb-user-forms .wppb-default-username,
.wppb-user-forms .wppb-default-password,
.wppb-user-forms .wppb-default-repeat-password {
  display: block !important;
  width: 100% !important;
  float: none !important;
  clear: both !important;
  text-align: left !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 8px 0 !important;
}

/* Inputs */
.wppb-user-forms input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.wppb-user-forms select,
.wppb-user-forms textarea {
  display: block !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
}

/* Helper / description text */
.wppb-user-forms .description,
.wppb-user-forms p,
.wppb-user-forms span:not(.wppb-required) {
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  text-align: left !important;
  color: rgba(0, 0, 0, 0.55) !important;
}

/* Checkbox blocks */
.wppb-user-forms .wppb-checkbox,
.wppb-user-forms .wppb-privacy-consent,
.wppb-user-forms .wppb-terms-and-conditions {
  text-align: left !important;
}

.wppb-user-forms .wppb-checkbox > label:first-child {
  display: block !important;
  width: 100% !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 10px 0 !important;
}

.wppb-user-forms .wppb-checkbox input[type="checkbox"],
.wppb-user-forms .wppb-privacy-consent input[type="checkbox"],
.wppb-user-forms .wppb-terms-and-conditions input[type="checkbox"] {
  margin-right: 8px !important;
  vertical-align: middle !important;
  transform: scale(1.15);
}

.wppb-user-forms input[type="checkbox"] + label,
.wppb-user-forms .wppb-checkbox label,
.wppb-user-forms .wppb-privacy-consent label,
.wppb-user-forms .wppb-terms-and-conditions label {
  display: inline !important;
  width: auto !important;
  float: none !important;
  clear: none !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}

/* Submit button alignment only */
.wppb-user-forms .form-submit,
.wppb-user-forms p.form-submit,
.wppb-user-forms li.wppb-form-field:last-child {
  text-align: center !important;
}

.wppb-user-forms input[type="submit"] {
  display: inline-block !important;
  width: auto !important;
  min-width: 180px !important;
  margin: 18px auto 0 auto !important;
}

/* =========================================
   EDIT PROFILE PAGE
   Replace 1385 if your edit-profile page ID differs
========================================= */

body.page-id-1385 .wppb-user-forms li {
  margin-bottom: 16px !important;
}

/* "Benutzer editieren" title */
body.page-id-1385 .wppb-edit-user h2,
body.page-id-1385 .wppb-edit-user h3,
body.page-id-1385 .wppb-edit-user legend {
  font-size: 20px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  margin: 0 0 14px 0 !important;
  display: block !important;
  width: 100% !important;
}

/* Keep edit profile field titles same size as register/login */
body.page-id-1385 .wppb-user-forms label,
body.page-id-1385 .wppb-user-forms .wppb-form-field > label,
body.page-id-1385 .wppb-user-forms .wppb-default-e-mail,
body.page-id-1385 .wppb-user-forms .wppb-default-first-name,
body.page-id-1385 .wppb-user-forms .wppb-default-last-name,
body.page-id-1385 .wppb-user-forms .wppb-default-username,
body.page-id-1385 .wppb-user-forms .wppb-default-password,
body.page-id-1385 .wppb-user-forms .wppb-default-repeat-password {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 8px 0 !important;
}

/* Nicer dropdown on edit profile page */
body.page-id-1385 .wppb-edit-user select,
body.page-id-1385 .wppb-user-forms .wppb-edit-user select {
  width: 100% !important;
  max-width: 360px !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 8px 38px 8px 12px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  color: rgba(25, 25, 25, 0.9) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(120, 120, 120, 0.45) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(60, 60, 60, 0.8) 50%),
    linear-gradient(135deg, rgba(60, 60, 60, 0.8) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* =========================================
   DOWNLOAD TABLES / DATATABLES
========================================= */

/* Table glass style */
table.tablepress,
table.custom-download-table,
.dt-container table {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(6px);
  border-collapse: collapse !important;
}

table.tablepress thead th,
table.custom-download-table thead th,
.dt-container table thead th {
  background: rgba(255, 255, 255, 0.16) !important;
}

table.tablepress tbody td,
table.custom-download-table tbody td,
.dt-container table tbody td {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Search area */
.dt-container .dt-search {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
  flex-wrap: wrap !important;
}

.dt-container .dt-search label {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: rgba(35, 35, 35, 0.82) !important;
}

.dt-container .dt-search input[type="search"] {
  width: 155px !important;
  height: 34px !important;
  padding: 6px 10px !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  color: rgba(34, 34, 34, 0.92) !important;
  border: 1px solid rgba(110, 110, 110, 0.55) !important;
  background: rgba(255, 255, 255, 0.58) !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}

/* Download button - less bright, more business style */
table a[href*="download_strapi_file"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 118px !important;
  padding: 8px 14px !important;
  background: rgba(28, 96, 180, 0.78) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14) !important;
  transition: all 0.2s ease !important;
}

table a[href*="download_strapi_file"]:hover {
  background: rgba(24, 83, 156, 0.9) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18) !important;
}

table a[href*="download_strapi_file"]:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14) !important;
}

table.tablepress td:last-child,
table.custom-download-table td:last-child,
.dt-container table td:last-child {
  text-align: center !important;
}

/* =========================================
   MOBILE TABLE FIX
   Generic version for all download pages
========================================= */

@media (max-width: 767px) {
  .dt-container {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .dt-container table,
  table.tablepress,
  table.custom-download-table {
    min-width: 560px !important;
  }

  .dt-container .dt-layout-row,
  .dt-container .dt-layout-cell {
    width: 100% !important;
  }

  .dt-container .dt-search {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  .dt-container .dt-search label {
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .dt-container .dt-search input[type="search"] {
    width: 120px !important;
    height: 30px !important;
    font-size: 12px !important;
    background: rgba(255, 255, 255, 0.5) !important;
  }

  /* Make Elementor boxed container fit phone better */
  .e-con-boxed > .e-con-inner {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Prevent ugly text breaking in table cells */
  .dt-container table th,
  .dt-container table td,
  table.tablepress th,
  table.tablepress td,
  table.custom-download-table th,
  table.custom-download-table td {
    white-space: nowrap !important;
  }

  /* Slightly smaller button on phone */
  table a[href*="download_strapi_file"] {
    min-width: 100px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
  }
}