/*
  Momentum Hub Theme (css/hub-theme.css)
  WBR-432: The shared visual system for The Momentum Hub, based on SeenInSeven.
  Provides colors, typography, border-radius, glows, and atmosphere in both dark and light modes.
*/

:root {
  /* SeenInSeven Dark Mode Palette (Default) */
  --bg:           #0D2828;
  --bg-page:      linear-gradient(180deg, #081c1c 0%, #0D2828 34%, #0b2424 68%, #071a1e 100%);
  --card:         #163636;
  --card2:        #1E4A4A;
  --border:       rgba(50, 184, 184, 0.22);
  --border-subtle: rgba(50, 184, 184, 0.12);
  --cream:        #F8FAFA;
  --soft:         #A8DEDE;
  --muted:        #68C8C8;
  --teal:         #32B8B8;
  --cyan:         #7DD8D8;
  --green:        #4ade80;
  --gold:         #C8A84B;
  --blue:         #2A9090;
  --teal-deep:    #0D2828;
  --teal-vivid:   #32B8B8;
  --teal-soft:    #68C8C8;
  --teal-bright:  #2A9090;
  --ink:          #0D2828;
  --danger:       #f28b82;
  --amber:        #f59e0b;
  --glow:         rgba(50, 184, 184, 0.35);

  /* Studio mappings (Dark Mode) */
  --studio-bg:        var(--bg);
  --studio-surface:   var(--card);
  --studio-surface-2: var(--card2);
  --studio-border:    var(--border);
  --studio-text:      var(--cream);
  --studio-soft:      var(--soft);
  --studio-muted:     var(--muted);
  --studio-teal:      var(--teal);
  --studio-gold:      var(--gold);
  --studio-green:     var(--green);
  --studio-danger:    var(--danger);
  --header-height:    76px;

  /* Typography */
  --font-body:    'Nunito', sans-serif;
  --font-display: 'Oswald', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --font-accent:  'Lora', serif;

  /* Rounded corners */
  --radius-sm:    6px;
  --radius-md:    9px;
  --radius-card:  16px;
  --radius-lg:    20px;
  --radius-pill:  999px;

  color-scheme: dark;
}

/* Light Mode Overrides */
html.studio-light,
body.light-mode {
  --bg:           #EFF8F8;
  --bg-page:      #EFF8F8;
  --card:         #FFFFFF;
  --card2:        #E3F2F2;
  --border:       rgba(26, 138, 138, 0.18);
  --border-subtle: rgba(26, 138, 138, 0.10);
  --cream:        #1A3535;
  --soft:         #2D5858;
  --muted:        #4A8888;
  --teal:         #1A8A8A;
  --cyan:         #2A9090;
  --green:        #237c49;
  --gold:         #96751e;
  --blue:         #1A7070;
  --teal-deep:    #EFF8F8;
  --teal-vivid:   #1A8A8A;
  --teal-soft:    #4A8888;
  --teal-bright:  #1A7070;
  --ink:          #1A3535;
  --danger:       #b43a32;
  --amber:        #b45309;
  --glow:         rgba(26, 138, 138, 0.20);

  /* Studio mappings (Light Mode) */
  --studio-bg:        var(--bg);
  --studio-surface:   var(--card);
  --studio-surface-2: var(--card2);
  --studio-border:    var(--border);
  --studio-text:      var(--cream);
  --studio-soft:      var(--soft);
  --studio-muted:     var(--muted);
  --studio-teal:      var(--teal);
  --studio-gold:      var(--gold);
  --studio-green:     var(--green);
  --studio-danger:    var(--danger);

  color-scheme: light;
}

/* Base resets & typography */
body {
  background: var(--bg-page);
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  min-height: 100vh;
}

/* Atmosphere: subtle aurora drift behind Hub pages */
.studio-layout::before,
.eee-workspace::before,
.story-chat::before {
  content: '';
  position: fixed;
  inset: -15%;
  background:
    radial-gradient(ellipse 46% 34% at 18% 8%,  rgba(50, 184, 184, 0.10) 0%, transparent 62%),
    radial-gradient(ellipse 40% 30% at 84% 88%, rgba(200, 168, 75, 0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: hubAuroraDrift 46s ease-in-out infinite alternate;
}

html.studio-light .studio-layout::before,
html.studio-light .eee-workspace::before,
html.studio-light .story-chat::before {
  background:
    radial-gradient(ellipse 46% 34% at 18% 8%,  rgba(26, 138, 138, 0.05) 0%, transparent 62%),
    radial-gradient(ellipse 40% 30% at 84% 88%, rgba(150, 117, 30, 0.04) 0%, transparent 60%);
}

@keyframes hubAuroraDrift {
  from { transform: translate3d(-1%, -1%, 0); }
  to   { transform: translate3d(1%, 1%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .studio-layout::before,
  .eee-workspace::before,
  .story-chat::before {
    animation: none;
  }
}

/* Warm Header Area */
.studio-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(13, 40, 40, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.15);
}

html.studio-light .studio-header {
  background: rgba(239, 248, 248, 0.96);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(26, 138, 138, 0.06);
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.studio-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--cream);
}

.studio-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.studio-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--teal) 65%, transparent);
  background: color-mix(in srgb, var(--teal) 14%, var(--card));
  color: var(--teal);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Header action buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--cream);
  background: color-mix(in srgb, var(--teal) 8%, var(--card));
}

.account-button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--soft);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s ease;
}

.account-button:hover {
  border-color: var(--teal);
  color: var(--cream);
  background: color-mix(in srgb, var(--teal) 8%, var(--card));
}

.account-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #071f1f;
  font-weight: 900;
  font-size: 12px;
}

html.studio-light .account-avatar {
  color: #ffffff;
}

/* Buttons with SeenInSeven 9px radius */
.primary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--teal);
  color: #071f1f;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

html.studio-light .primary-button {
  color: #ffffff;
}

.primary-button:hover {
  background: color-mix(in srgb, var(--teal) 86%, white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--glow);
}

.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--soft);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.secondary-button:hover {
  border-color: var(--teal);
  color: var(--cream);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

/* Left Sidebar - Cleaned Up & Refined */
.studio-sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  gap: 20px;
  z-index: 20;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  margin: 3px 0;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--cream);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
}

.nav-item:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.nav-item.active {
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  color: var(--teal);
  border-left: 3px solid var(--teal);
  font-weight: 800;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

/* Soft Cards & Dialogs */
.app-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.app-preview {
  border-top-left-radius: var(--radius-card);
  border-bottom-left-radius: var(--radius-card);
}

.auth-dialog {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.auth-dialog input,
input, textarea, select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
}

.account-menu {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
}

.account-menu a,
.account-menu button {
  border-radius: 6px;
}

.studio-notice,
.device-progress {
  border-radius: 12px;
}

/* EEE Gate & Shell Boxes */
.eee-gate-box {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Form inputs focus */
input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
  outline: none;
}
