/* BewegungsKI v3.0 — WordPress Plugin Styles */
/* Scoped under .bewegungski-container */


  .bewegungski-container {
    --bg: #0a0a0a;
    --surface: #111111;
    --border: #1e1e1e;
    --accent: #c8f135;
    --accent2: #ff4444;
    --accent3: #44aaff;
    --text: #e8e8e8;
    --muted: #555;
  }

  .bewegungski-container * { margin: 0; padding: 0; box-sizing: border-box; }

  .bewegungski-container {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 2px;
    color: var(--accent);
  }
  .logo span { color: var(--text); }

  .status-pill {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .status-pill.active { background: rgba(200,241,53,0.1); color: var(--accent); }
  .status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .status-pill.active .status-dot { animation: pulse 1.2s ease infinite; }

  @keyframes pulse {
    0%,100% { opacity: 1; } 50% { opacity: 0.3; }
  }

  .layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    height: calc(100vh - 57px);
  }

  /* Camera Zone */
  .camera-zone {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  #videoEl {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scaleX(-1);
    display: none;
  }

  #canvasEl {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: scaleX(-1);
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
  }

  .start-overlay {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 40px;
  }

  .start-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    animation: glow 2s ease infinite;
  }

  @keyframes glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(200,241,53,0.3); }
    50% { box-shadow: 0 0 20px 8px rgba(200,241,53,0.15); }
  }

  .start-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
  }

  .start-sub {
    color: var(--muted);
    font-size: 14px;
    max-width: 300px;
    line-height: 1.6;
  }

  .btn-start {
    background: var(--accent);
    color: #000;
    border: none;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    padding: 14px 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
  }
  .btn-start:hover { opacity: 0.9; transform: scale(1.02); }
  .btn-start:disabled { opacity: 0.5; cursor: wait; }
  .btn-start:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  /* Exercise selector overlay */
  .exercise-bar {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    z-index: 10;
    max-width: 95vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .exercise-bar::-webkit-scrollbar { display: none; }

  .ex-btn {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
  }
  .ex-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
  .ex-btn:hover:not(.active) { border-color: var(--text); color: var(--text); }
  .ex-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* Feedback overlay */
  .feedback-overlay {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 300px;
    text-align: center;
    z-index: 10;
    display: none;
  }

  .feedback-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
  }

  .feedback-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: var(--accent);
    transition: color 0.3s;
  }
  .feedback-text.warn { color: #ffaa00; }
  .feedback-text.bad { color: var(--accent2); }

  /* Camera lost warning */
  .camera-lost {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,68,68,0.9);
    color: #fff;
    padding: 16px 28px;
    border-radius: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
    z-index: 20;
    display: none;
  }

  /* Sidebar */
  .sidebar {
    border-left: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar-section {
    padding: 20px;
    border-bottom: 1px solid var(--border);
  }

  .section-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
  }

  /* Metric cards */
  .metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .metric {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .metric-name {
    font-size: 12px;
    color: var(--muted);
  }

  .metric-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: var(--text);
    letter-spacing: 1px;
  }
  .metric-value.ok { color: var(--accent); }
  .metric-value.warn { color: #ffaa00; }
  .metric-value.bad { color: var(--accent2); }

  /* Rep counter */
  .rep-display {
    text-align: center;
    padding: 10px 0;
  }

  .rep-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 72px;
    line-height: 1;
    color: var(--accent);
  }

  .rep-label {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 2px;
  }

  /* Checklist */
  .checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    transition: color 0.3s;
  }

  .check-item.ok { color: var(--text); }

  .check-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s;
  }
  .check-item.ok .check-dot { background: var(--accent); }
  .check-item.warn .check-dot { background: #ffaa00; }
  .check-item.bad .check-dot { background: var(--accent2); }

  /* History */
  .history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }

  .history-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
  }
  .history-badge.good { background: rgba(200,241,53,0.15); color: var(--accent); }
  .history-badge.ok { background: rgba(255,170,0,0.15); color: #ffaa00; }
  .history-badge.bad { background: rgba(255,68,68,0.15); color: var(--accent2); }

  /* Reset btn */
  .btn-reset {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
  }
  .btn-reset:hover { border-color: var(--accent2); color: var(--accent2); }
  .btn-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .disclaimer {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.6;
    font-family: 'DM Mono', monospace;
  }

  /* Loading */
  .loading-bar {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 12px;
  }
  .loading-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
    border-radius: 1px;
  }

  /* ===== Measurement Toggle Button (floating) ===== */
  .btn-measure {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 14px 28px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 2px rgba(200,241,53,0.3);
    transition: transform .15s, box-shadow .15s, background .15s;
  }
  .btn-measure:hover { transform: translateX(-50%) translateY(-2px); }
  .btn-measure:active { transform: translateX(-50%) translateY(0); }
  .btn-measure.measuring {
    background: var(--accent2);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 2px rgba(255,68,68,0.3);
    animation: measurePulse 1.6s ease-in-out infinite;
  }
  @keyframes measurePulse {
    0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 2px rgba(255,68,68,0.3); }
    50% { box-shadow: 0 4px 20px rgba(255,68,68,0.5), 0 0 0 6px rgba(255,68,68,0.2); }
  }

  /* ===== Tablet (700-1000px) ===== */
  @media (max-width: 1000px) and (min-width: 701px) {
    .layout {
      grid-template-columns: 1fr 260px;
    }
    .sidebar { padding: 16px; }
    .sidebar-section { margin-bottom: 16px; }
    .rep-number { font-size: 56px; }
  }

  /* ===== Mobile (<= 700px) ===== */
  @media (max-width: 700px) {
    .layout {
      grid-template-columns: 1fr;
      grid-template-rows: 65vh auto;
      height: auto;
      min-height: calc(100vh - 57px);
    }
    .camera-zone { min-height: 65vh; }
    .sidebar {
      max-height: none;
      padding: 12px;
      padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }
    .sidebar-section { margin-bottom: 12px; }
    .rep-number { font-size: 48px; }
    .metric { font-size: 12px; padding: 6px 8px; }
    .check-item { font-size: 12px; }

    /* Horizontally scrollable exercise bar */
    .exercise-bar {
      top: calc(env(safe-area-inset-top, 0px) + 8px);
      left: 8px;
      right: 8px;
      padding: 6px;
      gap: 4px;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: nowrap;
      flex-wrap: nowrap;
      scrollbar-width: none;
      -ms-overflow-style: none;
      justify-content: flex-start;
    }
    .exercise-bar::-webkit-scrollbar { display: none; }
    .ex-btn {
      font-size: 10px;
      padding: 6px 10px;
      flex-shrink: 0;
    }

    .btn-measure {
      bottom: 16px;
      min-width: 180px;
      padding: 12px 20px;
      font-size: 16px;
    }
    .feedback-overlay {
      bottom: 90px; /* make room for btn-measure */
    }
    header { padding: 10px 16px; }
    .logo { font-size: 18px; }
  }

  /* ===== Plugin Navigation ===== */
  .bewegungski-container .bki-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-family: 'DM Sans', sans-serif;
  }
  .bewegungski-container .bki-nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--accent);
    text-decoration: none;
  }
  .bewegungski-container .bki-nav-logo img {
    height: 24px;
    width: auto;
  }
  .bewegungski-container .bki-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .bewegungski-container .bki-nav-link {
    display: inline-block;
    padding: 6px 12px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s, border-color .15s;
  }
  .bewegungski-container .bki-nav-link:hover,
  .bewegungski-container .bki-nav-link.active {
    color: var(--accent);
    border-color: var(--accent);
  }
  .bewegungski-container .bki-nav-logout {
    color: var(--accent2);
  }
  .bewegungski-container .bki-nav-logout:hover {
    border-color: var(--accent2);
    color: var(--accent2);
  }
  .bewegungski-container .bki-nav-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
  }
  .bewegungski-container .bki-nav-role {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 1px;
  }
  @media (max-width: 700px) {
    .bewegungski-container .bki-nav {
      padding: 8px 12px;
      gap: 8px;
    }
    .bewegungski-container .bki-nav-link {
      font-size: 10px;
      padding: 5px 8px;
      letter-spacing: 1px;
    }
    .bewegungski-container .bki-nav-user { display: none; }
  }
