/* =========================================
   BUNKROS PROMPT MASTERCLASS STYLES
   Inherits from Global Variables
   ========================================= */

:root {
      /* Light Mode */
      --bg-primary: #FAF9F7;
      --bg-secondary: #FFFFFF;
      --bg-tertiary: #F5F4F1;
      --text-primary: #1A1A1A;
      --text-secondary: #4A4A4A;
      --text-muted: #7A7A7A;
      --accent-primary: #7C9885;
      --accent-secondary: #D4A574;
      --accent-tertiary: #8B7CF7;
      --border-color: rgba(0,0,0,0.08);
      --card-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
      --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
      --glow-color: rgba(124, 152, 133, 0.2);
      --gradient-hero: linear-gradient(135deg, #FAF9F7 0%, #F0EDE8 100%);
      --gradient-accent: linear-gradient(135deg, #7C9885 0%, #5A7A6A 100%);
      --gradient-warm: linear-gradient(135deg, #D4A574 0%, #C49664 100%);
      --code-bg: #F5F4F1;
      --overlay-bg: rgba(250, 249, 247, 0.95);
      --nav-bg: rgba(255, 255, 255, 0.8);
      --header-offset: 88px;
    }

    [data-theme="dark"] {
      --bg-primary: #0D0D12;
      --bg-secondary: #161620;
      --bg-tertiary: #1E1E2A;
      --text-primary: #F5F5F7;
      --text-secondary: #B8B8C0;
      --text-muted: #6B6B78;
      --accent-primary: #00D4FF;
      --accent-secondary: #8B7CF7;
      --accent-tertiary: #FF6B9D;
      --border-color: rgba(255,255,255,0.08);
      --card-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 1px rgba(255,255,255,0.1);
      --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.6), 0 0 1px rgba(0,212,255,0.3);
      --glow-color: rgba(0, 212, 255, 0.15);
      --gradient-hero: linear-gradient(135deg, #0D0D12 0%, #151525 50%, #1A1A2E 100%);
      --gradient-accent: linear-gradient(135deg, #00D4FF 0%, #0099CC 100%);
      --gradient-warm: linear-gradient(135deg, #8B7CF7 0%, #6B5CD7 100%);
      --code-bg: #1E1E2A;
      --overlay-bg: rgba(13, 13, 18, 0.95);
      --nav-bg: rgba(22, 22, 32, 0.8);
    }

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

    html {
      scroll-behavior: smooth;
      scroll-snap-type: y mandatory;
      overflow-y: scroll;
      scroll-padding-top: 0 !important;
    }

    @media (max-width: 768px) {
      :root {
        --header-offset: 76px;
      }
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg-primary);
      color: var(--text-primary);
      line-height: 1.6;
      transition: background 0.5s ease, color 0.5s ease;
      overflow-x: hidden;
    }

    h1, h2, h3, h4, h5, h6 {
      font-family: 'Space Grotesk', sans-serif;
      font-weight: 600;
      line-height: 1.2;
    }

    code, .mono {
      font-family: 'JetBrains Mono', monospace;
    }

    /* Theme Toggle */
    .theme-toggle {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 1000;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 1px solid var(--border-color);
      background: var(--nav-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      box-shadow: var(--card-shadow);
    }

    .theme-toggle:hover {
      transform: scale(1.1);
      box-shadow: var(--card-shadow-hover);
    }

    .theme-toggle svg {
      width: 22px;
      height: 22px;
      fill: var(--text-primary);
      transition: fill 0.3s ease;
    }

    .sun-icon { display: none; }
    .moon-icon { display: block; }
    [data-theme="dark"] .sun-icon { display: block; }
    [data-theme="dark"] .moon-icon { display: none; }

    /* Navigation */
    .nav-container,
    .nav-floating {
      position: fixed;
      left: 20px;
      top: 50%;
      transform: translateY(-50%);
      z-index: 900;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .nav-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--border-color);
      border: 2px solid transparent;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .nav-dot:hover {
      background: var(--accent-primary);
      transform: scale(1.3);
    }

    .nav-dot.active {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      box-shadow: 0 0 12px var(--glow-color);
    }

    .nav-arrows {
      position: fixed;
      right: 20px;
      bottom: 20px;
      z-index: 999;
      display: flex;
      gap: 8px;
    }

    .nav-arrow {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      border: 1px solid var(--border-color);
      background: var(--nav-bg);
      backdrop-filter: blur(20px);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      box-shadow: var(--card-shadow);
    }

    .nav-arrow:hover {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
    }

    .nav-arrow:hover svg {
      fill: white;
    }

    .nav-arrow svg {
      width: 20px;
      height: 20px;
      fill: var(--text-primary);
      transition: fill 0.3s ease;
    }

    /* Panels */
    .panel {
      min-height: 100dvh;
      width: 100%;
      scroll-snap-align: start;
      scroll-snap-stop: always;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 60px 20px;
      padding-top: calc(var(--header-offset) + 60px);
      position: relative;
      overflow: hidden;
    }

    .panel:last-of-type {
      padding-bottom: calc(var(--mobile-bottom-bar-height) + 40px);
    }

    .panel-content {
      max-width: 600px;
      width: 100%;
      z-index: 10;
    }

    .panel-number {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--accent-primary);
      margin-bottom: 16px;
      opacity: 0.8;
    }

    .panel-title {
      font-size: clamp(28px, 6vw, 42px);
      margin-bottom: 20px;
      background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .panel-subtitle {
      font-size: 18px;
      color: var(--text-secondary);
      margin-bottom: 32px;
      line-height: 1.7;
    }

    /* Cards */
    .card {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 24px;
      margin-bottom: 16px;
      box-shadow: var(--card-shadow);
      transition: all 0.3s ease;
    }

    .card:hover {
      box-shadow: var(--card-shadow-hover);
      transform: translateY(-2px);
    }

    .card-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .card-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }

    .card-text {
      font-size: 14px;
      color: var(--text-secondary);
      line-height: 1.6;
    }

    /* Interactive Elements */
    .prompt-box {
      background: var(--code-bg);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 20px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      line-height: 1.7;
      color: var(--text-primary);
      margin: 16px 0;
      position: relative;
      overflow: hidden;
    }

    .prompt-box::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: var(--gradient-accent);
    }

    .prompt-label {
      position: absolute;
      top: 8px;
      right: 12px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--accent-primary);
      font-family: 'Inter', sans-serif;
    }

    .highlight {
      background: linear-gradient(135deg, var(--glow-color) 0%, transparent 100%);
      padding: 2px 6px;
      border-radius: 4px;
    }

    .tag {
      display: inline-block;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      margin: 4px;
    }

    .tag-role { background: rgba(139, 124, 247, 0.15); color: #8B7CF7; }
    .tag-task { background: rgba(0, 212, 255, 0.15); color: #00D4FF; }
    .tag-context { background: rgba(124, 152, 133, 0.15); color: var(--accent-primary); }
    .tag-constraint { background: rgba(212, 165, 116, 0.15); color: #D4A574; }
    .tag-format { background: rgba(255, 107, 157, 0.15); color: #FF6B9D; }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 14px 28px;
      border-radius: 12px;
      font-family: 'Space Grotesk', sans-serif;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      border: none;
      text-decoration: none;
    }

    .btn-primary {
      background: var(--gradient-accent);
      color: white;
      box-shadow: 0 4px 16px var(--glow-color);
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px var(--glow-color);
    }

    .btn-secondary {
      background: var(--bg-secondary);
      color: var(--text-primary);
      border: 1px solid var(--border-color);
    }

    .btn-secondary:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }

    /* Sliders & Controls */
    .slider-container {
      margin: 20px 0;
    }

    .slider-label {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
      font-size: 13px;
    }

    .slider {
      width: 100%;
      height: 8px;
      border-radius: 4px;
      background: var(--bg-tertiary);
      appearance: none;
      cursor: pointer;
    }

    .slider::-webkit-slider-thumb {
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: var(--accent-primary);
      box-shadow: 0 2px 8px var(--glow-color);
      cursor: pointer;
    }

    /* Toggle Buttons */
    .toggle-group {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 16px 0;
    }

    .toggle-btn {
      padding: 10px 18px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-secondary);
      transition: all 0.3s ease;
    }

    .toggle-btn:hover {
      border-color: var(--accent-primary);
    }

    .toggle-btn.active {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
    }

    /* Modal */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--overlay-bg);
      backdrop-filter: blur(20px);
      z-index: 2000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .modal-overlay.open {
      display: flex;
      opacity: 1;
    }

    .modal {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      max-width: 500px;
      width: 100%;
      max-height: 80vh;
      overflow-y: auto;
      padding: 32px;
      box-shadow: var(--card-shadow-hover);
      transform: scale(0.95);
      transition: transform 0.3s ease;
    }

    .modal-overlay.open .modal {
      transform: scale(1);
    }

    .modal-close {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
    }

    .modal-close:hover {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
    }

    /* Decorative Elements */
    .glow-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.5;
      pointer-events: none;
    }

    .orb-1 {
      width: 300px;
      height: 300px;
      background: var(--accent-primary);
      top: -100px;
      right: -100px;
      opacity: 0.2;
    }

    .orb-2 {
      width: 400px;
      height: 400px;
      background: var(--accent-secondary);
      bottom: -150px;
      left: -150px;
      opacity: 0.15;
    }

    /* Grid Patterns */
    .grid-pattern {
      position: absolute;
      inset: 0;
      background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
      background-size: 40px 40px;
      opacity: 0.3;
      pointer-events: none;
    }

    /* Flow Diagram */
    .flow-container {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin: 24px 0;
    }

    .flow-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px;
      background: var(--bg-tertiary);
      border-radius: 12px;
      border: 1px solid var(--border-color);
      transition: all 0.3s ease;
    }

    .flow-item:hover {
      border-color: var(--accent-primary);
      transform: translateX(4px);
    }

    .flow-number {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--gradient-accent);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .flow-arrow {
      display: flex;
      justify-content: center;
      color: var(--text-muted);
      font-size: 20px;
    }

    /* Comparison Cards */
    .comparison-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin: 20px 0;
    }

    .comparison-card {
      padding: 16px;
      border-radius: 12px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }

    .comparison-card.bad {
      border-color: rgba(255, 100, 100, 0.3);
      background: linear-gradient(135deg, rgba(255, 100, 100, 0.05) 0%, transparent 100%);
    }

    .comparison-card.good {
      border-color: rgba(100, 255, 150, 0.3);
      background: linear-gradient(135deg, rgba(100, 255, 150, 0.05) 0%, transparent 100%);
    }

    .comparison-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 1px;
      text-transform: uppercase;
      margin-bottom: 8px;
    }

    .comparison-card.bad .comparison-label { color: #FF6464; }
    .comparison-card.good .comparison-label { color: #64FF96; }

    /* Progress Indicator */
    .progress-bar {
      position: fixed;
      top: 0;
      left: 0;
      height: 3px;
      background: var(--gradient-accent);
      z-index: 1001;
      transition: width 0.3s ease;
    }

    /* Checklist */
    .checklist {
      list-style: none;
      margin: 20px 0;
    }

    .checklist-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-color);
    }

    .checklist-item:last-child {
      border-bottom: none;
    }

    .checklist-check {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 2px solid var(--accent-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .checklist-check.checked {
      background: var(--accent-primary);
    }

    .checklist-check.checked::after {
      content: '✓';
      color: white;
      font-size: 12px;
      font-weight: 600;
    }

    /* Animations */
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes pulse {
      0%, 100% { opacity: 0.5; }
      50% { opacity: 0.8; }
    }

    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    .animate-in {
      animation: fadeInUp 0.6s ease forwards;
    }

    .animate-pulse {
      animation: pulse 3s ease-in-out infinite;
    }

    .animate-float {
      animation: float 6s ease-in-out infinite;
    }

    /* Panel-specific styles */
    #panel-1 {
      background: var(--gradient-hero);
    }

    #panel-1 .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 100px;
      font-size: 12px;
      font-weight: 500;
      margin-bottom: 24px;
      box-shadow: var(--card-shadow);
    }

    #panel-1 .hero-title {
      font-size: clamp(36px, 8vw, 56px);
      margin-bottom: 24px;
      line-height: 1.1;
    }

    #panel-1 .hero-title span {
      background: var(--gradient-accent);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    /* Token Visualization */
    .token-flow {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      padding: 20px;
      background: var(--code-bg);
      border-radius: 12px;
      margin: 16px 0;
    }

    .token {
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 13px;
      font-family: 'JetBrains Mono', monospace;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .token:hover {
      border-color: var(--accent-primary);
      transform: translateY(-2px);
    }

    .token.highlighted {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
    }

    /* Model Cards */
    .model-switcher {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin: 20px 0;
    }

    .model-card {
      padding: 16px;
      border-radius: 12px;
      border: 2px solid var(--border-color);
      background: var(--bg-secondary);
      cursor: pointer;
      transition: all 0.3s ease;
      text-align: center;
    }

    .model-card:hover {
      border-color: var(--accent-primary);
    }

    .model-card.active {
      border-color: var(--accent-primary);
      box-shadow: 0 0 20px var(--glow-color);
    }

    .model-name {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 4px;
    }

    .model-desc {
      font-size: 11px;
      color: var(--text-muted);
    }

    /* Ethics Scenario */
    .scenario-box {
      background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 24px;
      margin: 20px 0;
    }

    .scenario-question {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 16px;
      color: var(--text-primary);
    }

    .scenario-options {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .scenario-option {
      padding: 14px 18px;
      border-radius: 10px;
      border: 1px solid var(--border-color);
      background: var(--bg-secondary);
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 14px;
    }

    .scenario-option:hover {
      border-color: var(--accent-primary);
    }

    .scenario-option.selected {
      border-color: var(--accent-primary);
      background: linear-gradient(135deg, var(--glow-color) 0%, transparent 100%);
    }

    /* Prompt Library */
    .prompt-library-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin: 20px 0;
    }

    .prompt-library-item {
      padding: 16px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .prompt-library-item:hover {
      border-color: var(--accent-primary);
      box-shadow: var(--card-shadow-hover);
    }

    .prompt-library-title {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .prompt-library-category {
      font-size: 10px;
      padding: 3px 8px;
      border-radius: 4px;
      background: var(--accent-primary);
      color: white;
    }

    .prompt-library-desc {
      font-size: 13px;
      color: var(--text-secondary);
    }

    /* Mastery Badge */
    .mastery-badge {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 120px;
      height: 120px;
      border-radius: 50%;
      background: var(--gradient-accent);
      margin: 0 auto 24px;
      box-shadow: 0 0 40px var(--glow-color);
    }

    .mastery-badge-inner {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: var(--bg-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 40px;
    }

    /* Debug Panel */
    .debug-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 16px 0;
    }

    .debug-toggle {
      padding: 8px 14px;
      border-radius: 6px;
      font-size: 12px;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .debug-toggle.error {
      border-color: rgba(255, 100, 100, 0.5);
      color: #FF6464;
    }

    .debug-toggle.error.active {
      background: rgba(255, 100, 100, 0.2);
    }

    /* Responsive */
    @media (max-width: 480px) {
      .nav-container,
      .nav-floating {
        left: 10px;
      }

      .nav-arrows {
        right: 10px;
        bottom: 10px;
      }

      .theme-toggle {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
      }

      .panel {
        padding: 40px 16px;
        padding-top: calc(var(--header-offset) + 60px);
      }

      .comparison-grid {
        grid-template-columns: 1fr;
      }

      .model-switcher {
        grid-template-columns: 1fr;
      }
    }

    /* Scroll indicator */
    .scroll-indicator {
      position: absolute;
      bottom: 30px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      color: var(--text-muted);
      font-size: 12px;
      animation: float 2s ease-in-out infinite;
    }

    .scroll-indicator svg {
      width: 20px;
      height: 20px;
      fill: var(--text-muted);
    }

@media (max-width: 768px) {
    .comparison-grid { grid-template-columns: 1fr; }
    .panel {
      padding: 80px 16px 80px 16px;
      padding-top: calc(var(--header-offset) + 60px);
    }
}
