/* ============================================
   Mein Nestwerk - Buttons & Links
   Alle Button-Styles, Links, Switches
   ============================================
   Version: 2.1
   Datum: 2025-11-25
   Konsolidiert: Toggle-Switch vereinheitlicht
   ============================================ */

/* ===== Links ===== */
a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.15s ease;
}

a:hover,
a:focus {
  text-decoration: underline;
  color: var(--accent-strong);
}

a:active {
  opacity: 0.8;
}

/* ===== Standard Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  line-height: 1.1;
  flex: 1 1 240px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn--primary {
  background: var(--accent-strong);
  border-color: var(--ci-white);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Secondary Button */
.btn--secondary {
  background: var(--ci-white);
  border-color: var(--accent-strong);
  color: var(--fg);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  color: #fff;
  transform: translateY(-1px);
}

.btn--secondary:active:not(:disabled) {
  transform: translateY(0);
}

/* Delete Button */
.btn--delete {
  background: #dc3545;
  border-color: #c82333;
  color: #fff;
}

.btn--delete:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn--delete:active:not(:disabled) {
  transform: translateY(0);
}

.btn--delete img {
  width: 16px;
  height: 16px;
}

/* Button Row */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

/* ===== Kontakt-Buttons ===== */
.btn-contact {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-delete-contact {
  background: white;
  border-color: #EF5350;
  color: #EF5350;
  flex: 0 0 auto;
  min-width: auto;
  padding: 10px 12px;
}

.btn-delete-contact:hover {
  background: #EF5350;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 83, 80, 0.3);
}

.btn-delete-contact img {
  width: 18px;
  height: 18px;
  display: block;
}

/* ===== Toggle Switch (KONSOLIDIERT) ===== */
.switch,
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
  position: relative;
}

/* Für inline-block Variante ohne Label */
.toggle-switch {
  display: inline-block;
  width: 52px;
  height: 28px;
  min-height: unset;
  gap: 0;
}

.switch input,
.toggle-switch input {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.slider,
.toggle-slider {
  position: relative;
  width: 46px;
  height: 26px;
  background: #e5e7eb;
  border: 2px solid var(--accent-soft);
  border-radius: 999px;
  transition: 0.15s;
  flex-shrink: 0;
}

.toggle-slider {
  width: 52px;
  height: 28px;
  background-color: #BDBDBD;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.slider::after,
.toggle-slider::before {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}

.slider::after {
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
}

.toggle-slider::before {
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
}

.switch input:checked + .slider,
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.switch input:checked + .slider::after {
  transform: translateX(20px);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.switch input:focus + .slider,
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--accent-strong);
}

.switch-label {
  user-select: none;
  font-size: 0.95rem;
}

.switch.is-active .slider {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.switch.is-active .slider::after {
  transform: translateX(20px);
}

/* ===== Info-Badge (Tooltip-Icon) ===== */
.tip {
  position: relative;
  display: inline-block;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--accent-soft);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
  cursor: help;
}

.tip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 13px;
  z-index: 100;
  pointer-events: none;
}

.tip[data-tip]:hover::before {
  content: "";
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

/* ===== Radio Button Labels styled as Buttons ===== */
.btn-row input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.btn-row .btn-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  line-height: 1.1;
  flex: 1 1 240px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-size: 1rem;
  background: var(--ci-white);
  border-color: var(--accent-strong);
  color: var(--fg);
}

.btn-row .btn-label:hover {
  background: var(--accent-soft);
  color: #fff;
  transform: translateY(-1px);
}

.btn-row input[type="radio"]:checked + .btn-label {
  background: var(--accent-strong);
  border-color: var(--ci-white);
  color: #fff;
}

.btn-row input[type="radio"]:checked + .btn-label:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Button aria-pressed aktiv Status */
button.btn[aria-pressed="true"] {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

/* ===== Grid-2 für Button-Row ===== */
.btn-row.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .btn {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-contact {
    width: 100%;
  }
}

/* ===== Button Flex-Utilities ===== */
.btn--flex-auto {
  flex: 0 0 auto;
}
