/* =========================================================
   SHORTS — Instagram Reels Style
   Desktop: 9:16 Stage + Action-Rail (Rechts) + Titel-Overlay (Unten)
   Mobile:  Vollbild, Action-Rail rechts, Comments als Slide-up-Sheet
   ========================================================= */

html, body {
  height: 100%;
  overflow: hidden;
  background: #000; /* Reels = immer dunkle Bühne */
}

#content {
  margin-left: 0 !important;
  padding: 0 !important;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

/* Top-Controls auf dunkler Bühne lesbar halten */
#shorts-page #toggleSidebar,
#shorts-page #topControls .icon-btn,
#shorts-page #topControls .top-btn {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(8px);
}

/* ===== STAGE ===== */
#shorts-root {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: clip;
  background: #000;
}

#shorts-column {
  position: relative;
  height: 100%;
  width: min(100vw, calc(100dvh * 9 / 16));
}

/* Einzelner Short */
.short {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  transition: transform 0.35s ease;
  will-change: transform;
}

@media (max-width: 700px) {
  .short { border-radius: 0; }
}

.short video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Leichte Vignette für Overlay-Lesbarkeit */
.short::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 28%),
    linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, transparent 18%);
}

/* ===== TITEL / CREATOR OVERLAY (unten links) ===== */
.short-meta {
  position: absolute;
  left: 14px;
  right: 78px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.short-creator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.short-creator-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.short-creator-btn:hover { transform: none; opacity: 0.85; }

.short-creator-btn .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8690ff, #ff5e8a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.85);
}

.short-creator-btn .avatar .icon { width: 16px; height: 16px; }
.short-creator-btn .avatar img { border-radius: 50%; }

.short-title {
  font-size: 13.5px;
  line-height: 1.35;
  color: rgba(255,255,255,0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== ACTION-RAIL (rechts an's Edge, Reels-Style) ===== */
.short-actions {
  position: absolute;
  right: 10px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.action-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
}

.action-pill:hover { transform: none; }

.action-pill .action-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.15s ease, transform 0.12s ease;
}

.action-pill .action-icon .icon { width: 22px; height: 22px; }

.action-pill:active .action-icon { transform: scale(0.92); }

.action-pill.active .action-icon {
  background: rgba(255, 59, 71, 0.35);
  border-color: rgba(255, 59, 71, 0.9);
  color: #ff3b47;
}

.action-pill .action-count {
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* ===== LEER-ZUSTAND ===== */
.shorts-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #aaa;
  padding: 24px;
}

.shorts-placeholder p {
  font-size: 16px;
  color: #fff;
  margin: 0;
}

.shorts-placeholder span {
  font-size: 13px;
  color: #888;
}

/* =========================================================
   COMMENTS — Slide-up Sheet (Reels-Style)
   ========================================================= */
.comments-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.comments-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.comments-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5100;
  background: var(--bg);
  color: var(--text);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  height: min(72dvh, 640px);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.35);
}

.comments-sheet.open {
  transform: translateY(0);
}

@media (min-width: 701px) {
  .comments-sheet {
    left: 50%;
    right: auto;
    width: 420px;
    max-width: calc(100vw - 320px);
    border-radius: 18px;
    bottom: 20px;
    transform: translate(-50%, 105%);
    height: min(70dvh, 620px);
  }
  .comments-sheet.open { transform: translate(-50%, 0); }
}

.sheet-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.sheet-close:hover { transform: none; }
.sheet-close .icon { width: 18px; height: 18px; }

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-row .c-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, var(--accent), #ff5e8a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.comment-row .c-body { min-width: 0; flex: 1; }

.comment-row .c-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-row .c-name {
  font-weight: 700;
  font-size: 13px;
}

.comment-row .c-time {
  font-size: 11px;
  color: var(--muted);
}

.comment-row .c-text {
  font-size: 13.5px;
  line-height: 1.4;
  margin-top: 2px;
  word-wrap: break-word;
}

.comment-row .c-del {
  background: none;
  border: none;
  box-shadow: none;
  padding: 2px;
  color: var(--muted);
  cursor: pointer;
}

.comment-row .c-del:hover { transform: none; color: var(--text); }
.comment-row .c-del .icon { width: 14px; height: 14px; }

.comments-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.comments-input {
  display: flex;
  gap: 10px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  align-items: center;
}

.comments-input input {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0 16px;
  font-size: 14px;
  outline: none;
}

.comments-input input:focus { border-color: var(--accent); }

.comments-input button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  color: #fff;
  box-shadow: none;
}

.comments-input button:hover { transform: none; opacity: 0.9; }
.comments-input button .icon { width: 18px; height: 18px; }

/* ===== SHORTS MOBILE (Top-Bar 56px) ===== */
@media (max-width: 600px) {
  #shorts-page #content { padding-top: 56px !important; }
  .shorts-placeholder { padding-top: 56px; }
}
