/* === En Route & Preview sectie === */
.cabin-settings-page {
  max-width: 1540px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 2.4vw, 2.25rem) 2.5rem;
}

.cabin-settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.cabin-settings-title {
  max-width: 48rem;
}

.cabin-settings-title h3 {
  font-size: clamp(2.35rem, 3vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.cabin-settings-title p {
  font-size: clamp(1.05rem, 1.4vw, 1.5rem);
  line-height: 1.45;
  color: #5f6772 !important;
}

.cabin-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cabin-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.4rem;
  padding: 0.8rem 1.15rem;
  border-radius: 1rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(39, 78, 143, 0.18);
}

.cabin-header-btn--ghost {
  background: #31589f;
  border: 1px solid #31589f;
  color: #fff;
}

.cabin-header-btn--ghost:hover,
.cabin-header-btn--ghost:focus {
  background: #274E8F;
  border-color: #274E8F;
  color: #fff;
}

.cabin-header-btn--primary {
  background: linear-gradient(135deg, #1872f2 0%, #1f6eea 100%);
  border: 1px solid rgba(24, 114, 242, 0.95);
  color: #fff;
}

.cabin-header-btn--primary:hover,
.cabin-header-btn--primary:focus {
  background: linear-gradient(135deg, #1264d4 0%, #195fd0 100%);
  border-color: rgba(18, 100, 212, 0.98);
  color: #fff;
}

.cabin-sync-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

.cabin-sync-icon .fa-calendar-alt {
  font-size: 0.98rem;
}

.cabin-sync-icon .fa-rotate-right {
  font-size: 0.86rem;
}

.cabin-login-actions {
  align-items: center;
}

.cabin-inline-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.setup-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-tabs {
  border-bottom: 2px solid #e9ecef;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #6c757d;
  font-weight: 500;
  padding: 1rem 1.5rem;
}
.nav-tabs .nav-link.active {
  color: #274E8F;
  border-bottom-color: #274E8F;
  background: none;
}

.preview-container {
  background: #f8f9fa;
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1.5rem;
}
.preview-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.preview-label {
  font-size: 0.95rem;
  color: #6c757d;
  margin-right: 0.5rem;
}
.preview-calendar {
  display: flex;
  position: relative;
  background: #fff;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  min-height: 140px;
  padding-top: 0.4rem;
}
.preview-day {
  flex: 1;
  padding: 0.25rem 0.5rem 3.6rem;
  text-align: center;
  font-weight: 600;
  color: #495057;
  border-right: 1px solid #e9ecef;
  position: relative;
  font-size: 1.05rem;
}
.preview-day:last-child {
  border-right: none;
}
.preview-event {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 68%;
  transform: translateY(-50%);
  background: #274E8F;
  color: #fff;
  padding: .65rem .5rem;
  border-radius: .8rem;
  font-weight: 600;
  font-size: .9rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(61,109,253,.25);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* === Family ICS Mobile Styles === */
@media (max-width: 768px) {
  .cabin-settings-page {
    padding: 0.75rem 1rem 1.75rem;
  }

  .cabin-settings-hero {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .cabin-settings-title h3 {
    font-size: clamp(2rem, 7vw, 2.65rem);
  }

  .cabin-settings-title p {
    font-size: 1rem;
  }

  .cabin-settings-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .cabin-header-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.75rem 0.95rem;
  }

  .cabin-inline-sync-btn {
    width: 100%;
  }

  /* Familie ICS sectie aanpassingen voor mobiel */
  .alert .d-flex.align-items-start {
    flex-direction: column !important;
    gap: 15px;
  }
  
  .alert .d-flex.align-items-start > div:first-child {
    order: 1;
  }
  
  .alert .d-flex.align-items-start > form {
    order: 2;
    margin-left: 0 !important;
    align-self: stretch;
  }
  
  /* Input group voor ICS URL - naast elkaar op mobiel */
  .input-group {
    flex-direction: row !important;
    gap: 0;
  }
  
  .input-group .form-control {
    flex: 1;
    border-radius: 0.375rem 0 0 0.375rem !important;
    font-size: 10px !important;
    padding: 6px 8px !important;
    height: auto !important;
    min-height: 32px !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.1 !important;
  }
  
  .input-group .btn {
    flex: 0 0 auto;
    border-radius: 0 0.375rem 0.375rem 0 !important;
    width: auto !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-width: 50px !important;
  }
  
  /* ICS URL input specifiek voor mobiel */
  #icsLinkInput {
    font-size: 10px !important;
    line-height: 1.1 !important;
    padding: 6px 8px !important;
    height: auto !important;
    min-height: 32px !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
  
  /* Kopieer knop kleiner maken */
  #copyIcsBtn {
    padding: 6px 8px !important;
    font-size: 11px !important;
    min-width: 40px !important;
  }


  
  /* Familie ICS URL input group voor mobiel */
  #familyIcsLinkInput {
    font-size: 10px !important;
    line-height: 1.1 !important;
    padding: 6px 8px !important;
    height: auto !important;
    min-height: 32px !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
  
  /* Familie ICS kopieer knop */
  #copyFamilyIcsBtn {
    padding: 6px 8px !important;
    font-size: 11px !important;
    min-width: 40px !important;
  }
  
  /* Familie ICS knoppen voor mobiel */
  .btn-sm {
    padding: 8px 12px;
    font-size: 14px;
    min-width: auto;
    white-space: nowrap;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 14px;
    min-width: auto;
    white-space: nowrap;
  }
  
  .btn-outline-primary,
  .btn-outline-danger {
    padding: 8px 12px;
  }
  
  /* Familie ICS lijst items voor mobiel */
  .alert ul {
    padding-left: 20px;
    margin-bottom: 15px;
  }
  
  .alert ul li {
    margin-bottom: 5px;
    font-size: 14px;
  }
  
  /* Familie ICS card header voor mobiel */
  .card-body .d-flex.align-items-center {
    flex-direction: column;
    text-align: center;
  }
  
  .card-body .d-flex.align-items-center .circle-icon {
    margin-right: 0 !important;
    margin-bottom: 15px;
  }
  
  .card-body .d-flex.align-items-center > div {
    text-align: center;
  }
  
  /* Header knoppen naast elkaar blijven op mobiel */
  .settings-header .d-flex.gap-2 {
    flex-direction: row !important;
    gap: 8px !important;
  }
  
  .settings-header .d-flex.gap-2 .btn {
    flex: 1 !important;
    justify-content: center;
  }
  
  /* Pijltje links van Dashboard tekst */
  .settings-header .btn i.fa-arrow-left {
    margin-right: 8px !important;
    margin-left: 0 !important;
  }
  
  /* Familie ICS alert heading aanpassingen */
  .alert-heading {
    font-size: 16px;
  }
  
  .alert p {
    font-size: 14px;
  }
  
  .alert small {
    font-size: 12px;
  }
  
  /* Kleine knoppen naast elkaar op mobiel - alleen voor de "je nieuwe link" sectie */
  .d-flex.gap-2 {
    flex-direction: row !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  
  .d-flex.gap-2 .btn {
    width: auto !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  
  .d-flex.gap-2 .btn-sm {
    padding: 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 992px) {
  .cabin-settings-hero {
    flex-direction: column;
  }

  .cabin-settings-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* === Visibility rows === */
.visibility-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.visibility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  padding: 16px 20px;
  gap: 16px;
}
.visibility-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.visibility-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-shrink: 0;
}
.visibility-text {
  flex: 1;
}
.visibility-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  font-size: 1rem;
}
.visibility-desc {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
}
.visibility-toggle {
  position: relative;
  width: 40px;
  height: 20px;
  flex-shrink: 0;
}
.visibility-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* === Enroute rows === */
.enroute-config {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}
.enroute-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.enroute-row {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  padding: 12px 16px;
  gap: 12px;
}

/* Toggle switch */
.enroute-toggle {
  position: relative;
  width: 40px;
  height: 20px;
  flex-shrink: 0;
}
.enroute-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.2s;
  border-radius: 20px;
  /* iOS/touch verbeteringen voor schuiven */
  touch-action: pan-y; /* sta verticale scroll toe, maar blokkeer horizontaal voor drag */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: #5875a4;
}
input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Label */
.enroute-label {
  flex: 1;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

/* Arrow buttons */
.enroute-arrows {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.arrow-btn {
  width: 28px;
  height: 28px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  color: #6c757d;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrow-btn:hover {
  background: #e9ecef;
  border-color: #5875a4;
  color: #5875a4;
}
.arrow-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
  color: #adb5bd;
}

/* Tijden container */
.enroute-tijden-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.tijden-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tijden-toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tijden-sublabel {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  min-width: 50px;
}





/* === Form & utility === */
.input-locked {
  background: #f1f3f4 !important;
  color: #adb5bd !important;
  border-color: #dee2e6 !important;
  cursor: not-allowed;
  font-style: italic;
}
.input-locked::placeholder {
  color: #c0c4c9;
}

/* === Responsive small screens === */
@media (max-width: 768px) {
  .nav-tabs .nav-link {
    padding: .75rem 1rem;
    font-size: .9rem;
    flex: 1;
    text-align: center;
    min-width: 0;
  }
  
  /* Account beheer pagina - compactere spacing tussen form elementen */
  .page-container .card .mb-4 {
    margin-bottom: 0.75rem !important;
  }
  
  .page-container .card .mb-3 {
    margin-bottom: 0.5rem !important;
  }
  .settings-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .settings-header .btn {
    align-self: flex-end;
    font-size: .8rem;
    padding: .4rem .8rem;
  }
  .settings-actions-mobile.d-lg-none {
    margin-left: 1rem !important;
    margin-top: .75rem !important;
  }
  .settings-actions-mobile .btn-sm {
    padding: .75rem 1rem !important;
    font-size: .95rem !important;
    line-height: 1.4 !important;
    min-height: 2.75rem !important;
  }
  .col-lg-4 .card.sticky-top {
    display: none;
  }
  .col-lg-8 { width: 100%; }
  .d-flex.flex-lg-column {
    flex-direction: row !important;
    align-items: flex-start;
  }
  .nav-tabs {
    flex: 1;
    margin-bottom: 1rem !important;
  }
  
  /* Visibility responsive */
  .visibility-row {
    padding: 12px 16px;
    gap: 12px;
  }
  .visibility-content {
    gap: 12px;
  }
  .visibility-icon {
    width: 36px;
    height: 36px;
  }
  .visibility-label {
    font-size: 0.95rem;
  }
  .visibility-desc {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .settings-actions-mobile {
    flex-direction: column;
    gap: .75rem;
  }
  .settings-actions-mobile .btn {
    font-size: .95rem;
    padding: .75rem 1rem;
    min-height: 2.75rem;
    line-height: 1.4;
  }
  .nav-tabs .nav-link {
    padding: .5rem .75rem;
    font-size: .85rem;
    flex: 1;
    text-align: center;
    min-width: 0;
  }
}

/* Compact save button styling */
.save-btn-compact {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

.save-btn-compact .fas {
  font-size: 14px !important;
}

/* === Automatische Opslag Status === */
.save-status-container {
  margin-top: 1rem;
  text-align: center;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.save-status.text-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: #198754;
  border: 1px solid rgba(25, 135, 84, 0.2);
}

.save-status.text-warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
  }
  50% {
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
  }
  100% {
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
  }
}

/* Mobile optimalisatie voor status indicator */
@media (max-width: 767.98px) {
  .save-status-container {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .save-status {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
  }
}

/* Toast Notificaties */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  padding: 1rem;
  border-radius: 0.375rem;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
}

.toast-success {
  background-color: #198754;
}

.toast-error {
  background-color: #dc3545;
}

.toast i {
  margin-right: 0.5rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === Pushmeldingen: knop spacing === */
#ui-push-enable {
  margin-right: 0.5rem; /* horizontale ruimte */
  margin-bottom: 0.5rem; /* verticale ruimte bij wrapping */
}

/* Toon 'Meldingen' tab alleen op touch devices (o.a. iPad/iPhone), verberg op desktops/laptops */
.notifications-touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .notifications-touch-only { display: block; }
}
/* Toon ook in PWA standalone mode, ongeacht device type */
@media (display-mode: standalone) {
  .notifications-touch-only { display: block; }
}
