/* ==========================================================================
   grimsomething.com — Handcrafted Obsidian & Violet Laboratory Aesthetic
   Dark violet ambient glows, obsidian cards, sharp typography, distinct character.
   ========================================================================== */

:root {
  /* Handcrafted Deep Obsidian & Amethyst Palette */
  --bg-main: #060509;
  --bg-surface: #0e0b16;
  --bg-surface-hover: #161224;
  --bg-subtle: #130f1f;

  --border: #211936;
  --border-hover: #4a3478;
  --border-focus: #c084fc;

  --text-primary: #f5f2fd;
  --text-secondary: #ad9fcf;
  --text-tertiary: #6b5c91;

  /* Expressive Purple Accents */
  --accent: #c084fc;          /* Electric Lavender Accent */
  --accent-secondary: #9333ea;/* Deep Royal Purple */
  --accent-glow: rgba(192, 132, 252, 0.25);
  --accent-subtle: rgba(192, 132, 252, 0.08);

  --emerald: #34d399;
  --sky: #38bdf8;
  --rose: #fb7185;
  
  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Structure */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ambient Radial Glow Background */
body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(147, 51, 234, 0.15), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(192, 132, 252, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

::selection {
  background: var(--accent);
  color: #000;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #282d3c;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.navbar-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 5, 9, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(147, 51, 234, 0.1));
  border: 1px solid var(--border-hover);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-subtle);
}

.brand-accent {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(14, 11, 22, 0.6);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.nav-item {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.25), rgba(147, 51, 234, 0.15));
  border: 1px solid var(--border-hover);
  box-shadow: 0 0 12px var(--accent-subtle);
}

.nav-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

.admin-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
}

.admin-trigger-btn.unlocked {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}

/* Page View Router */
.page-view {
  animation: pageIn 0.18s ease;
}

.page-view.hidden {
  display: none !important;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem 0;
}

.hero-header {
  margin-bottom: 2rem;
}

.identity-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.username-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.domain-tld {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(192, 132, 252, 0.4));
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
}

.hero-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.social-links-grid {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.social-pill:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.hero-stats-strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-section {
  padding: 2.5rem 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.projects-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

/* Controls Filter */
.filter-bar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 2rem 0.55rem 2.4rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-surface-hover);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  cursor: pointer;
}

.categories-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
}

.cat-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.cat-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.cat-tab.active {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: linear-gradient(145deg, rgba(22, 18, 36, 0.7), rgba(14, 11, 22, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 132, 252, 0.3), transparent);
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: linear-gradient(145deg, rgba(30, 24, 50, 0.85), rgba(18, 14, 30, 0.95));
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(192, 132, 252, 0.08);
}

.project-card:hover::before {
  opacity: 1;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.badge-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.badge-status.live {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-status.wip {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  border-color: rgba(245, 158, 11, 0.25);
}

.badge-status.concept {
  background: rgba(56, 189, 248, 0.1);
  color: var(--sky);
  border-color: rgba(56, 189, 248, 0.25);
}

.badge-status.archived {
  background: rgba(101, 108, 125, 0.1);
  color: var(--text-tertiary);
  border-color: var(--border);
}

.fav-star-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.05rem;
  transition: var(--transition);
}

.fav-star-btn:hover, .fav-star-btn.starred {
  color: var(--accent);
}

.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.btn-link:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-accent:hover {
  opacity: 0.9;
}

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

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.full-width {
  width: 100%;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Interactive Lab Section
   ========================================================================== */
.lab-section {
  padding: 2.5rem 0;
}

.lab-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lab-tabs-nav {
  display: flex;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.lab-tab-btn {
  flex: 1;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.lab-tab-btn:hover {
  color: var(--text-primary);
}

.lab-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-surface);
}

.lab-panel {
  display: none;
  padding: 1.5rem;
}

.lab-panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-title {
  font-size: 1.15rem;
}

.panel-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* Scratchpad */
.scratchpad-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: 240px;
}

@media (max-width: 768px) {
  .scratchpad-workspace {
    grid-template-columns: 1fr;
  }
}

#scratchpad-input {
  width: 100%;
  height: 240px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
  line-height: 1.5;
}

#scratchpad-input:focus {
  outline: none;
  border-color: var(--accent);
}

.scratchpad-preview {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  overflow-y: auto;
  font-size: 0.88rem;
  max-height: 240px;
}

/* Palette Swatches */
.palette-swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
}

.swatch-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.swatch-card:hover {
  border-color: var(--border-hover);
}

.swatch-color-box {
  height: 75px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.swatch-hex {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.swatch-name {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Audio Synth Matrix */
.synth-pads-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .synth-pads-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.synth-pad {
  height: 80px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.synth-pad:hover {
  border-color: var(--accent);
}

.synth-pad.active {
  background: var(--accent);
  color: #000;
}

.synth-pad.active .pad-freq {
  color: #222;
}

.pad-note {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.pad-freq {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
  padding: 2.5rem 0;
}

.about-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 850px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-heading {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.about-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.quick-instructions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.about-code-preview {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-header {
  background: var(--bg-surface);
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.about-code-preview pre {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow-x: auto;
  line-height: 1.5;
}

.code-keyword { color: #f43f5e; }
.code-prop { color: #38bdf8; }
.code-string { color: #10b981; }

/* ==========================================================================
   Live Chatroom Section
   ========================================================================== */
.chat-section {
  padding: 2.5rem 0;
}

.chat-wrapper-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}

.chat-user-settings-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.chat-setting-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chat-setting-group input {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  width: 140px;
}

.chat-setting-group input:focus {
  border-color: var(--accent);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-color-opt {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.chat-color-opt:hover {
  transform: scale(1.15);
}

.chat-color-opt.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.chat-messages-container {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-main);
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 85%;
  animation: fadeIn 0.15s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.chat-msg-username {
  font-weight: 700;
  font-family: var(--font-mono);
}

.chat-msg-time {
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.chat-msg-text {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  border-radius: 0 10px 10px 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg-row.own-msg {
  align-self: flex-end;
}

.chat-msg-row.own-msg .chat-msg-text {
  border-radius: 10px 0 10px 10px;
  background: var(--accent-subtle);
  border-color: rgba(168, 85, 247, 0.3);
}

.chat-input-bar {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.chat-input-bar input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

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

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-section {
  padding: 2.5rem 0;
}

.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 780px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.contact-info-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-link-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.contact-link-item:hover {
  color: var(--accent);
}

.contact-link-icon {
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form-note {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Admin Auth & Studio Panel Styles
   ========================================================================== */
.admin-auth-card {
  max-width: 420px;
  text-align: center;
}

.admin-auth-header {
  margin-bottom: 1.5rem;
}

.auth-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.admin-auth-header h3 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.admin-auth-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  margin-bottom: 1.15rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.error-msg {
  color: var(--rose);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.gh-sync-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Studio section label separators */
.studio-section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.studio-section-label:first-child {
  margin-top: 0;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-main);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
  background: #000;
}

/* Admin Studio Panel */
.admin-studio-card {
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.admin-studio-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-title-group h2 {
  font-size: 1.3rem;
  margin-top: 0.2rem;
}

.studio-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-close-btn.relative {
  position: relative;
  top: 0;
  right: 0;
}

.admin-studio-tabs {
  display: flex;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.studio-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.studio-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-surface);
}

.admin-studio-content {
  padding: 1.5rem;
  overflow-y: auto;
}

.studio-panel {
  display: none;
}

.studio-panel.active {
  display: block;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.projects-manager-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-project-form-container {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-project-form-container h5 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.admin-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-project-item {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-item-info h5 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.admin-item-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Export Code Blocks */
.export-intro {
  margin-bottom: 1.25rem;
}

.export-intro h4 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.export-intro p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.export-block {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.export-header {
  background: var(--bg-main);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.export-block pre {
  padding: 1rem;
  background: #08090b;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-primary);
}

/* ==========================================================================
   Modal & Footer
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  padding: 1.75rem;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.hidden {
  display: none !important;
}

/* Chat Login Gate */
.chat-login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
