/*
============================================================
Club OS Studio
Datei: polish.css
Zweck: Finaler UI-, Accessibility- und Interaction-Polish
Phase: 13.13B - Router, Modal & UI Polish
============================================================
*/

/*
============================================================
ACCESSIBILITY
============================================================
*/

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;

  padding: 10px 14px;

  border: 1px solid var(--studio-primary-light);
  border-radius: var(--studio-radius-sm);

  color: white;
  background: var(--studio-primary-dark);

  font-size: 0.78rem;
  font-weight: 800;

  box-shadow: var(--studio-shadow);

  transform: translateY(-160%);

  transition: transform var(--studio-transition);
}

.skip-link:focus {
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(160, 120, 255, 0.72);
  outline-offset: 3px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.studio-main-content:focus {
  outline: none;
}

/*
============================================================
VIEW TRANSITIONS
============================================================
*/

.view-container {
  animation: studio-view-enter 180ms ease;
}

.view-container.is-view-loading {
  pointer-events: none;
}

.view-error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;

  margin-top: 22px;
}

@keyframes studio-view-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
============================================================
BODY / MODAL LOCK
============================================================
*/

body.studio-modal-open {
  overflow: hidden;
}

body.studio-sidebar-open {
  overflow: hidden;
}

/*
============================================================
TOAST POLISH
============================================================
*/

.toast {
  position: relative;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 11px;

  padding: 15px 15px 15px 16px;
}

.toast__icon {
  display: grid;

  width: 24px;
  height: 24px;

  border-radius: 7px;

  color: var(--studio-text);
  background: rgba(255, 255, 255, 0.08);

  font-size: 0.72rem;
  font-weight: 900;

  place-items: center;
}

.toast__content {
  min-width: 0;
}

.toast__message {
  display: block;

  color: var(--studio-text);

  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast__close {
  display: grid;

  width: 25px;
  height: 25px;

  padding: 0;

  border: none;
  border-radius: 7px;

  color: var(--studio-text-muted);
  background: transparent;

  font-size: 1rem;

  place-items: center;

  transition:
    color var(--studio-transition),
    background var(--studio-transition);
}

.toast__close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.toast--success .toast__icon {
  color: var(--studio-success);
  background: rgba(54, 211, 153, 0.12);
}

.toast--error .toast__icon {
  color: var(--studio-danger);
  background: rgba(251, 113, 133, 0.12);
}

.toast--warning .toast__icon {
  color: var(--studio-warning);
  background: rgba(248, 197, 85, 0.12);
}

.toast--info .toast__icon {
  color: var(--studio-info);
  background: rgba(96, 165, 250, 0.12);
}

.toast.is-leaving {
  animation: toast-leave 160ms ease forwards;
}

@keyframes toast-leave {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/*
============================================================
CONNECTION STATUS
============================================================
*/

.connection-status {
  position: fixed;
  z-index: 9998;
  right: 22px;
  bottom: 22px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 9px 13px;

  border: 1px solid rgba(251, 113, 133, 0.34);
  border-radius: 999px;

  color: #fecdd3;
  background: rgba(70, 15, 27, 0.94);

  font-size: 0.7rem;
  font-weight: 740;

  box-shadow: var(--studio-shadow);
}

.connection-status::before {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--studio-danger);

  content: "";
}

/*
============================================================
SIDEBAR POLISH
============================================================
*/

.sidebar-link[aria-current="page"] {
  border-color: rgba(124, 77, 255, 0.3);

  color: white;
  background: rgba(124, 77, 255, 0.16);
}

.sidebar-link:disabled {
  opacity: 0.4;
}

/*
============================================================
MOBILE
============================================================
*/

@media (max-width: 620px) {
  .view-error-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .view-error-actions .studio-button {
    width: 100%;
  }

  .toast-container {
    right: 16px;
    bottom: 16px;
    left: 16px;

    width: auto;
  }

  .connection-status {
    right: 16px;
    bottom: 16px;
    left: 16px;

    justify-content: center;
  }
}

/*
============================================================
REDUCED MOTION
============================================================
*/

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}
