/* ===========================================================
   Domain Manager Custom CSS
   Einheitliches Layout für Desktop & Mobile (Sidebar + Header)
   =========================================================== */

/* --- Global font setup (nur Header nutzt BankGthd) --- */
@font-face {
  font-family: 'BankGthd';
  src: url('../fonts/bankgthd.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f4f6f3;
  color: #222;
  margin: 0;
  padding: 0;
}

/* Sidebar removed – cleanup of obsolete styles */

/* ===========================================================
   HEADER / NAVBAR (oberer Balken)
   =========================================================== */

.navbar {
  background-color: #f8f9fa;
  border-bottom: 1px solid #ccc;
}

.navbar .sidebar-toggle {
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
  color: #333;
  cursor: pointer;
}

.navbar .sidebar-toggle:focus {
  outline: 2px solid rgba(0,123,255,0.25);
  outline-offset: 2px;
}

/* Header Title verwendet BankGthd */
.navbar-brand {
  font-family: 'BankGthd', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  font-size: 1.5rem;
  color: #213F6B !important;
}

/* Offcanvas/sidebar styles removed */

/* ===========================================================
   ICONS / AVATAR
   =========================================================== */

.sidebar .sidebar-link i.align-middle {
  margin-right: 0.5rem;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* ===========================================================
   FOOTER
   =========================================================== */

.footer {
  background-color: #fafafa;
  border-top: 1px solid #ccc;
  font-size: 0.85rem;
  color: #777;
  padding: 0.5rem 1rem;
}

.footer span {
  color: #555;
}

/* ===========================================================
   LAYOUT & POLISH
   =========================================================== */

/* Hauptinhalt: Sidebar entfernt, alte margin-left überschreiben */
@media (min-width: 992px) {
  .main {
    margin-left: 0 !important; /* remove leftover gap from former sidebar */
  }
}

/* Ensure footer sticks to bottom when page content is short
   Use flex layout: .main is column-flex and .content grows to fill available space.
   The footer uses mt-auto to push itself to the bottom. */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main .content {
  flex: 1 1 auto;
}

/* Center page content and keep 30px left/right gap regardless of screen width */
.container-wide {
  width: 100%;
  max-width: 1440px; /* adjust as needed */
  margin: 0 auto;
  padding-left: 30px;
  padding-right: 30px;
}

/* Klickoverlay für mobile Sidebar (Hamburger) */
.wrapper.sidebar-open::after {
  content: '';
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1025;
}

/* ==============================================================
    Tabellenanpassungen Dashboard
   ============================================================== */

.table-compact>:not(caption)>*>* {
    padding: 0.1rem 0.5rem !important;
}

/* Card Styling */
.account-card {
    max-width: 480px;          /* hübsche Breite für Desktop */
    width: 100%;               /* voll auf Mobile */
}

/* Bubble header link style: normal font, blue color and underline */
/* Unified bubble header style (all bubbles incl. Register/Transfer) */
.bubble-header-link {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  color: #213F6B;
  text-decoration: underline;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.5rem; /* unified size */
  line-height: 1.15;
}

/* Make all text inside the menu "bubbles" non-bold and visually uniform
   This ensures headers and list items in the bubble cards are not bold. */
.menu-bubble-card,
.menu-bubble-card .card-body,
.bubble-header-link,
.menu-bubble-list,
.menu-bubble-list li {
  font-weight: normal;
}

/* Stronger override: Bootstrap defines b,strong { font-weight: bolder } and utility
   classes like .fw-bolder may be applied. Ensure nothing inside the bubble card
   remains bold by using a descendant selector with !important. */
.menu-bubble-card, .menu-bubble-card * {
  font-weight: normal !important;
}

/* Header Dashboard link (breadcrumb) */
.header-dashboard-link {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  color: #213F6B;
  text-decoration: underline;
  font-size: 1.2rem; /* slightly larger */
}

/* Menu items in header that are not links (same font but not underlined) */
.header-menu-item {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  color: #213F6B;
  text-decoration: none;
  font-size: 1.2rem;
}


/* compact breadcrumb: tighter spacing between Dashboard and the separator/item */
.breadcrumb-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* small horizontal gap between elements */
    white-space: nowrap;
}

.breadcrumb-compact .breadcrumb-sep {
    margin: 0;
    color: #213F6B; /* same blue as headers */
    font-weight: 600;
    line-height: 1;
}

/* ensure Dashboard/menu items have no extra margins */
.header-dashboard-link,
.header-menu-item {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}
/* Etwas kompakter auf Desktop */
@media (min-width: 992px) {
    .account-card {
        margin-top: 1rem;
    }
}

/* Button kompakter */

.btn-group-sm>.btn,
.btn-sm {
    --bs-btn-padding-y: 0.10rem !important;
}


@media (min-width: 992px) {
  nav.navbar.sticky-top {
    display: none !important;
  }
}

/* menu Header Bottom Border */
.offcanvas-header {
  border-bottom: 1px solid #5A802E !important;
}

/* Menu bubble card standardization: ensure same spacing and list appearance
   across dashboard and menu pages */
.menu-bubble-card {
  margin-bottom: 1rem;
  height: 440px; /* doubled height for consistent tall bubbles */
  display: flex;
  flex-direction: column;
}

.menu-bubble-card .card-body {
  padding: 15px !important; /* uniform 15px padding from bubble edge */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.menu-bubble-list li {
  padding: 2px 0;
  color: #153b62;
}

@media (max-width: 576px) {
  /* ensure list items inside menu bubbles look like cards on xs */
  .menu-bubble-card { border-radius: 10px; }
  .menu-bubble-card .menu-bubble-list li { display: block; }
}

/* Ensure list content inside the bubble is left-aligned with a 50px offset
   from the bubble border while keeping the bubble header centered */
.menu-bubble-list {
  padding-left: 0;   /* reset default ul padding */
  text-align: left;
  overflow: hidden;
  flex: 1 1 auto;
}

/* On very small screens reduce the offset so items don't overflow */
@media (max-width: 420px) {
  .menu-bubble-list { margin-left: 16px; }
}

/* Ensure the list body text inside bubbles is black on desktop and retain the blue header */
.menu-bubble-list, .menu-bubble-list li {
  color: #000 !important;
}

/* Slightly smaller variant of the bubble header used for compact actions */
.bubble-header-small {
  font-size: 1.25rem; /* smaller than the default 1.75rem */
}

/* Desktop bubble sizing for 4-per-row look using Bootstrap cols
   Cols are set in HTML: col-lg-3 yields 4 per row on large screens
   Ensure other non-menu bubble cards align visually */
.menu-bubble-card, .card.menu-bubble-card {
  min-width: 0; /* allow flex shrink within columns */
}

/* Wide bubbles (double width) may contain long lists — allow vertical scrolling inside body */
@media (min-width: 992px) {
  .menu-bubble-card.wide-bubble .card-body { overflow-y: auto; }
}

/* ===========================================================
   Buttons – Green variant used across Register/Transfer flow
   =========================================================== */
.btn-green {
  color: #5A802E !important;            /* text */
  background-color: #E8F5E9 !important; /* bg */
  border: 1px solid #5A802E !important; /* border */
}
.btn-green:hover,
.btn-green:focus {
  color: #5A802E !important;
  background-color: #e2f0e4 !important; /* slightly darker on hover */
  border-color: #4d6f28 !important;
}
.btn-green:active {
  color: #5A802E !important;
  background-color: #d9eadb !important;
  border-color: #466624 !important;
}
.btn-green:disabled,
.btn-green.disabled {
  opacity: .65;
  pointer-events: none;
}

/* Hold-to-confirm generic button container */
.hold-btn, #dnsZoneSave, #dnsZoneDelete, #contactSave {
  position: relative;
  overflow: hidden;
}
.hold-progress {
  position: absolute;
  top: 0; left: 0; height: 100%; width: 0;
  transition: none; /* width transition is set dynamically in JS */
  z-index: 0;
}
.hold-btn-text { position: relative; z-index: 2; display: inline-block; }

/* Specific color variants (DNS already inline-styled, fallback here) */
#contactSave .hold-progress { background: #198754; }
#dnsZoneSave .hold-progress { background: #198754; }
#dnsZoneDelete .hold-progress { background: #dc3545; }

/* Save buttons: default green style, hover becomes white base for visibility of fill */
#contactSave.btn:hover,
#dnsZoneSave.btn:hover,
#contactSave.btn:focus,
#dnsZoneSave.btn:focus {
  background-color: #ffffff !important;
  color: #5A802E !important;
  border-color: #5A802E !important;
}

/* ===========================================================
   Text – Green utility + Choose links without underline
   =========================================================== */
.text-green { color: #5A802E !important; }

/* Apply green color and remove underline to the 'Choose' anchors */
.choose-contact {
  color: #5A802E !important;
  text-decoration: none !important;
}
.choose-contact:hover,
.choose-contact:focus {
  color: #466624 !important; /* slightly darker on hover/focus */
  text-decoration: none !important;
}

/* ===========================================================
   Common action button enhancer (applied to all bubble buttons)
   =========================================================== */
.dv-action-btn {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, filter .15s ease;
}
.dv-action-btn:hover,
.dv-action-btn:focus {
  filter: brightness(1.02);
}

/* ===========================================================
   Clone button (light blue appearance)
   =========================================================== */
.btn-clone {
  background-color: #E6F2FF; /* light blue */
  color: #2F6FA5;
  border: 1px solid #2F6FA5;
}
.btn-clone:hover,
.btn-clone:focus {
  background-color: #ffffff;
  color: #255679;
  border-color: #255679;
}
.btn-clone:active {
  background-color: #d4e9ff;
  color: #1e4b68;
}

/* Delete button (danger style, white base like clone) */
.btn-delete {
  background-color: #ffffff;
  color: #dc3545;
  border: 1px solid #dc3545;
}
.btn-delete:hover,
.btn-delete:focus {
  background-color: #ffffff;
  color: #b02a37;
  border-color: #b02a37;
}
.btn-delete .hold-progress { background: #dc3545; opacity: .2; }

/* ===========================================================
   Required field highlighting
   =========================================================== */
.dv-form-group.dv-required .form-label::after,
label.dv-required::after {
  content: ' *';
  color: #dc3545; /* Bootstrap danger red */
  font-weight: 600;
}
.dv-form-group.dv-required .form-control:not([readonly]) {
  border-color: #ffc107; /* Bootstrap warning */
}
.dv-form-group.dv-required .form-control:not([readonly]):focus {
  box-shadow: 0 0 0 .2rem rgba(255,193,7,.25);
}

/* Lighten placeholder text for phone inputs */
input[placeholder*='+49']::placeholder {
  color: #c0c0c0;
  opacity: 1;
}

/* ===========================================================
   Unified Bubble Action Overlay (domains + register/transfer)
   =========================================================== */
.bubble-card { position: relative; }
.bubble-action-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff;
  border: 1px solid #5A802E;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  border-radius: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.bubble-action-overlay .bubble-action-close { white-space: nowrap; }
.bubble-action-overlay .bubble-action-feedback { min-height: 1rem; }
.bubble-action-overlay .chooser-item,
.bubble-action-overlay .bubble-action-list li,
.bubble-action-overlay [data-value] {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.4;
  color: #5A802E;
  background-color: #E8F5E9;
  border: 1px solid #5A802E;
  margin-bottom: 4px;
  transition: none;
  text-align: left;
}
.bubble-action-overlay .chooser-item:hover,
.bubble-action-overlay .chooser-item:focus,
.bubble-action-overlay .bubble-action-list li:hover,
.bubble-action-overlay .bubble-action-list li:focus,
.bubble-action-overlay [data-value]:hover,
.bubble-action-overlay [data-value]:focus {
  background: #E8F5E9;
  outline: none;
  border-color: #5A802E;
  color: #5A802E;
}
.bubble-action-overlay .chooser-item.saving { opacity: .6; }
.bubble-action-overlay .chooser-item.saved { background: #e2f0e4; }

/* ===========================================================
   Unified Popup Layout Components  
   =========================================================== */
.bubble-action-overlay .popup-header {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #f8f9fa;
}

.bubble-action-overlay .popup-content {
  padding: 0.75rem;
  flex: 1;
  overflow: auto;
  min-height: 0; /* Important for flexbox overflow */
}

.bubble-action-overlay .popup-footer {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #6c757d;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: end;
  flex-shrink: 0;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}

/* DNS Zone overlay header fix */
#dnsZoneOverlay > div:first-child,
#addDnsZoneOverlay > div:first-child {
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* DNS Zone save button hover effect */
#dnsZoneSave:hover {
  background: #ffffff !important;
  color: #0f5132 !important;
}

/* DNS Zone delete button hover effect */
#dnsZoneDelete:hover {
  background: #ffffff !important;
  color: #dc3545 !important;
}

/* DNS zone buttons inside DNS Zones bubble */
.zone-btn {
  text-align: left;
  padding-left: 0.75rem;
  font-weight: 600;
}

.contact-btn {
  text-align: left;
  padding-left: 0.75rem;
  font-weight: 600;
}

/* Ensure check button fills the inner bubble width nicely */
.menu-bubble-card .btn.w-100 {
  display: block;
}

/* ===========================================================
   Domain detail overlay – compact floating labels on inputs
   =========================================================== */
.dv-form-group { position: relative; margin-bottom: 0.75rem; }
.dv-form-group > label {
  position: absolute;
  top: -1.1rem;
  left: 0.3rem;
  background: #fff;
  padding: 0 0.35rem;
  font-size: 0.82rem;
  color: #2b3e6f;
}
/* Label für read-only Felder mit transparentem Hintergrund */
.dv-form-group:has(> .form-control[readonly]) > label {
  background: transparent;
}
.dv-form-group > .form-control.form-control-sm {
  padding: 0.45rem 0.6rem;
  border: 1px solid #c8ccd4;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  text-align: center;
}
/* Read-only date fields with gray background */
.dv-form-group > .form-control.form-control-sm[readonly] {
  background-color: #f8f9fa;
}
.dv-multiline-box {
  border: 1px solid #c8ccd4; border-radius: 0.6rem; background: #fff;
  padding: 0.4rem 0.6rem; font-size: 0.95rem;
}
.dv-multiline label { color:#2b3e6f; font-size: 0.82rem; margin-bottom: 0.1rem; }

/* DNS small fields (type, ttl, priority) */
.dns-small-field { width: 70px; min-width: 70px; }

/* ===========================================================
   Contact Info Popup (mouseover/tap)
   =========================================================== */
.contact-info-popup {
  position: absolute;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #5A802E;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  padding: 0.75rem;
  min-width: 280px;
  max-width: 320px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.contact-info-popup.visible {
  opacity: 1;
  pointer-events: auto;
}

.contact-info-popup .popup-handle {
  font-weight: 600;
  color: #5A802E;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.35rem;
}

.contact-info-popup .popup-field {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  color: #333;
}

.contact-info-popup .popup-field-label {
  font-weight: 500;
  color: #666;
  display: inline-block;
  min-width: 80px;
}

.contact-info-popup .popup-field-value {
  color: #222;
}

/* Mobile: prevent popup on mobile, rely on tap behavior */
@media (max-width: 991px) {
  .contact-info-popup {
    display: none;
  }
}
