/* ============================================================
   LCARS Theme — Star Trek Computer Interface
   ============================================================ */

/* --- Typography --- */

.lcars-page {
  font-family: 'Antonio', sans-serif;
  letter-spacing: 0.05em;
}

/* --- Color Utilities --- */

.lcars-bg-primary { background-color: hsl(var(--primary)); }
.lcars-bg-secondary { background-color: hsl(var(--secondary)); }
.lcars-bg-accent { background-color: hsl(var(--accent)); }
.lcars-bg-muted { background-color: hsl(var(--muted)); }
.lcars-text-primary { color: hsl(var(--primary)); }
.lcars-text-secondary { color: hsl(var(--secondary)); }
.lcars-text-accent { color: hsl(var(--accent)); }

/* --- Frame Layout --- */

.lcars-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0.5rem;
  gap: 0.25rem;
}

.lcars-body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  flex: 1;
  gap: 0.25rem;
}

.lcars-content-area {
  display: grid;
  grid-template-columns: 12rem 0.25rem 1fr;
  gap: 0;
  flex: 1;
}

.lcars-frame-full .lcars-body-full {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
}

/* --- Elbow Brackets --- */

.lcars-elbow-top,
.lcars-elbow-bottom {
  display: flex;
  align-items: stretch;
  height: 2rem;
}

.lcars-elbow-corner {
  width: 12rem;
  min-width: 12rem;
  background-color: hsl(var(--primary));
}

.lcars-elbow-tl {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 2rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.lcars-elbow-bl {
  border-top-left-radius: 0;
  border-top-right-radius: 2rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lcars-bar {
  flex: 1;
  margin-left: 0.25rem;
}

.lcars-bar-top {
  background-color: hsl(var(--secondary));
  border-radius: 0 0 1rem 0;
}

.lcars-bar-bottom {
  background-color: hsl(var(--secondary));
  border-radius: 0 1rem 0 0;
}

.lcars-bar-accent {
  height: 0.5rem;
  background: linear-gradient(
    to right,
    hsl(var(--primary)) 0%,
    hsl(var(--primary)) 30%,
    hsl(var(--secondary)) 30%,
    hsl(var(--secondary)) 60%,
    hsl(var(--accent)) 60%,
    hsl(var(--accent)) 100%
  );
  border-radius: 0.25rem;
}

/* --- Divider (between sidebar and main) --- */

.lcars-divider {
  background-color: hsl(var(--primary));
  width: 0.25rem;
}

/* --- Sidebar --- */

.lcars-sidebar-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lcars-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.lcars-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  border-radius: 0 1.5rem 1.5rem 0;
  text-decoration: none;
  color: hsl(var(--background));
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: filter 0.15s ease;
  min-height: 2.5rem;
}

.lcars-sidebar-btn:hover {
  filter: brightness(1.2);
}

.lcars-sidebar-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Main Content --- */

.lcars-main-area {
  padding: 1.5rem 2rem;
}

.lcars-main-full {
  flex: 1;
  padding: 2rem;
}

.lcars-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
}

/* --- Header Block --- */

.lcars-header-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.lcars-header-pill {
  width: 6rem;
  height: 2.5rem;
  border-radius: 1.25rem;
  flex-shrink: 0;
}

.lcars-header-title-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lcars-title {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsl(var(--primary));
  line-height: 1;
  margin: 0;
}

.lcars-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--secondary));
}

.lcars-header-indicators {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.lcars-stardate {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.lcars-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.25rem 0.75rem;
  border-radius: 0.75rem;
}

.lcars-status-online {
  background-color: hsl(var(--primary));
  color: hsl(var(--background));
  animation: lcars-pulse 3s ease-in-out infinite;
}

.lcars-status-standby {
  background-color: hsl(var(--secondary));
  color: hsl(var(--background));
}

.lcars-status-alert {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  animation: lcars-blink 1s step-end infinite;
}

.lcars-status-offline {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.lcars-editor-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--accent));
  opacity: 0.7;
}

/* --- Panel Block --- */

.lcars-panel {
  border-left: 0.25rem solid hsl(var(--primary));
  margin: 1rem 0;
}

.lcars-panel-secondary { border-left-color: hsl(var(--secondary)); }
.lcars-panel-accent { border-left-color: hsl(var(--accent)); }

.lcars-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.lcars-panel-header-pill {
  width: 3rem;
  height: 1.25rem;
  background-color: inherit;
  border-radius: 0.625rem;
  background-color: hsl(var(--primary));
}

.lcars-panel-secondary .lcars-panel-header-pill { background-color: hsl(var(--secondary)); }
.lcars-panel-accent .lcars-panel-header-pill { background-color: hsl(var(--accent)); }

.lcars-panel-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsl(var(--foreground));
  white-space: nowrap;
}

.lcars-panel-header-bar {
  flex: 1;
  height: 0.125rem;
  background-color: hsl(var(--border));
}

.lcars-panel-body {
  padding: 0.75rem 1rem 0.75rem 1.25rem;
}

/* --- Heading Override --- */

.lcars-heading {
  font-family: 'Antonio', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: hsl(var(--primary));
  border-bottom: 0.125rem solid hsl(var(--primary));
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
}

.lcars-heading-1 { font-size: 2.25rem; }
.lcars-heading-2 { font-size: 1.75rem; }
.lcars-heading-3 { font-size: 1.375rem; }
.lcars-heading-4 { font-size: 1.125rem; }

/* --- Text Override --- */

.lcars-prose {
  color: hsl(var(--foreground));
  line-height: 1.7;
  font-size: 1rem;
}

.lcars-prose a {
  color: hsl(var(--secondary));
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.lcars-prose a:hover {
  color: hsl(var(--primary));
}

.lcars-prose strong {
  color: hsl(var(--primary));
}

.lcars-prose code {
  background-color: hsl(var(--muted));
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

/* --- Footer --- */

.lcars-footer-area {
  padding: 0.5rem 0;
}

/* --- Animations --- */

@keyframes lcars-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes lcars-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .lcars-content-area {
    grid-template-columns: 1fr;
  }

  .lcars-sidebar-area {
    display: none;
  }

  .lcars-divider {
    display: none;
  }

  .lcars-elbow-corner {
    width: 4rem;
    min-width: 4rem;
  }

  .lcars-sidebar-btn {
    border-radius: 1.5rem;
    justify-content: center;
  }

  .lcars-header-pill {
    width: 3rem;
  }

  .lcars-title {
    font-size: 1.5rem;
  }

  .lcars-main-area {
    padding: 1rem;
  }
}
