/* ===========================================================
   Web Component Sandbox — Styles
   Theme: Dark mode · Premium · Glassmorphism
   =========================================================== */

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

:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --accent: #00CEC9;
  --bg: #0B0E11;
  --bg-card: rgba(20, 24, 32, 0.7);
  --bg-hover: rgba(108, 92, 231, 0.08);
  --border: rgba(108, 92, 231, 0.15);
  --glass-border: rgba(255, 255, 255, 0.06);
  --text: #E8E6F0;
  --text-muted: #8B8A9E;
  --text-dim: #5A5872;
  --success: #00B894;
  --danger: #FF6B6B;
  --warning: #FDCB6E;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --transition: 220ms ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }

.app-container { max-width: 1300px; margin: 0 auto; padding: 24px 20px 60px; }

/* Header */
.app-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.logo-group { display: flex; align-items: center; gap: 12px; }
.app-header h1 {
  font-size: 1.35rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tagline { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.header-actions { display: flex; gap: 8px; }

/* Buttons */
.btn { border: none; cursor: pointer; font-family: var(--font); font-weight: 600; border-radius: var(--radius-sm); transition: all var(--transition); }
.btn-sm { font-size: 0.78rem; padding: 6px 14px; }
.btn-xs { font-size: 0.7rem; padding: 3px 8px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #5B4BD5; }
.btn-secondary { background: rgba(108,92,231,0.15); color: var(--primary-light); }
.btn-secondary:hover { background: rgba(108,92,231,0.25); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-accent { background: var(--accent); color: #0B0E11; }
.btn-accent:hover { background: #00B5B0; }

/* Main Layout */
.main-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Editors */
.editors { display: flex; flex-direction: column; gap: 12px; }
.editor-panel {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(12px);
}
.editor-tab {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--glass-border);
}
.tab-label { font-size: 0.78rem; font-weight: 600; color: var(--accent); font-family: var(--mono); }
.tab-hint { font-size: 0.7rem; color: var(--text-dim); }

.code-editor {
  width: 100%; min-height: 120px; padding: 12px 14px; border: none; outline: none; resize: vertical;
  background: transparent; color: var(--text); font-family: var(--mono); font-size: 0.8rem;
  line-height: 1.6; tab-size: 2;
}

/* Right Panel */
.right-panel { display: flex; flex-direction: column; gap: 12px; }

.preview-section, .inspector-section, .attrs-section {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 14px; backdrop-filter: blur(12px);
}
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.section-header h2 { font-size: 0.88rem; font-weight: 600; }

.preview-frame {
  width: 100%; min-height: 200px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff;
}

.shadow-tree {
  background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted);
  max-height: 150px; overflow-y: auto; white-space: pre-wrap; min-height: 60px;
}

.attrs-list { display: flex; flex-direction: column; gap: 6px; }
.attr-row {
  display: flex; gap: 8px; align-items: center;
}
.attr-input {
  flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--mono); font-size: 0.78rem; padding: 5px 8px; outline: none;
}
.attr-input:focus { border-color: var(--primary); }

.error-bar {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 20px;
  background: rgba(255,107,107,0.95); color: #fff; font-size: 0.8rem; font-family: var(--mono);
  z-index: 100; transition: transform 0.3s ease;
}
.error-bar.hidden { transform: translateY(100%); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,92,231,0.2); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
}
