html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.kodentek-wordmark {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5f9ff;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Global custom square checkbox used across modules */
.form-check.custom-checkbox {
  display: flex;
  align-items: center;
}
.form-check.custom-checkbox .form-check-input {
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1.5px solid rgba(6,35,43,0.12);
  border-radius: 4px;
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.form-check.custom-checkbox .form-check-input::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.9);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}
.form-check.custom-checkbox .form-check-input:checked {
  background: var(--main-color);
  border-color: var(--main-color);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}
.form-check.custom-checkbox .form-check-input:checked::after {
  border-color: #fff;
  opacity: 1;
}
.form-check.custom-checkbox .form-check-label {
  margin-left: 10px;
  cursor: pointer;
}

/* Make horizontal scrollbars visible and improve table overflow UX */
.table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.table-responsive table th,
.table-responsive table td {
  white-space: nowrap;
}

/* WebKit scrollbar styling (Chrome, Edge, Safari) */
.table-responsive::-webkit-scrollbar {
  height: 10px;
}
.table-responsive::-webkit-scrollbar-track {
  background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

/* Firefox scrollbar styling */
.table-responsive {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.25) transparent;
}

/* Visible horizontal scrollbar below tables (prominent) */
.table-horizontal-scrollbar {
  height: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  margin-top: 6px;
}
.table-horizontal-scrollbar .table-horizontal-inner {
  height: 2px; /* inner element only defines width */
}

/* Make the native scrollbar more visible on WebKit */
.table-horizontal-scrollbar::-webkit-scrollbar {
  height: 12px;
}
.table-horizontal-scrollbar::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
}
.table-horizontal-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(37,140,251,0.95), rgba(37,140,251,0.9));
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08) inset;
}

/* Firefox styling fallback */
.table-horizontal-scrollbar {
  scrollbar-color: rgba(37,140,251,0.9) rgba(0,0,0,0.04);
  scrollbar-width: thin;
}

/* Shared Ilcesiz toggle panel used on create/edit forms */
.form-check.form-switch:has(> #ilcesizToggle) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "toggle label"
    "help help";
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem !important;
  border: 1px solid rgba(13, 110, 253, 0.18);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.form-check.form-switch:has(> #ilcesizToggle) > #ilcesizToggle {
  grid-area: toggle;
  justify-self: start;
  float: none;
  margin: 0;
  width: 1.65rem;
  height: 1.65rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: none !important;
  background-color: #fff;
  border: 1.5px solid rgba(6, 35, 43, 0.12);
  border-radius: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.form-check.form-switch:has(> #ilcesizToggle) > #ilcesizToggle::after {
  content: "";
  position: absolute;
  left: 0.54rem;
  top: 0.24rem;
  width: 0.4rem;
  height: 0.8rem;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .12s ease;
}

.form-check.form-switch:has(> #ilcesizToggle) > .form-check-label {
  grid-area: label;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #102a43;
  cursor: pointer;
}

.form-check.form-switch:has(> #ilcesizToggle) > .form-text {
  grid-area: help;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #5b6b7a;
}

.form-check.form-switch:has(> #ilcesizToggle) > .form-text::after {
  content: "Ilcesiz secerseniz herkes gorup uzerinde islem yapabilir.";
  display: block;
  margin-top: 0.45rem;
  color: #b42318;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.form-check.form-switch:has(> #ilcesizToggle) > #ilcesizToggle:checked {
  background-color: var(--main-color);
  border-color: var(--main-color);
}

.form-check.form-switch:has(> #ilcesizToggle) > #ilcesizToggle:checked::after {
  border-color: #fff;
  opacity: 1;
}

.form-check.form-switch:has(> #ilcesizToggle) > #ilcesizToggle:focus {
  box-shadow: 0 0 0 0.2rem rgba(52, 179, 230, 0.18);
}

@media (max-width: 767.98px) {
  .form-check.form-switch:has(> #ilcesizToggle) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "toggle label"
      "help";
  }
}
