/* beta.css - Shared component styles for unsandbox.com
   Page-specific styles in: console.css, home.css, pricing.css, blog.css, docs.css, legal.css, admin.css */

/* ==================
   BASE STYLES
   ================== */
body {
  font-size: 24px;
  background: var(--secondary-bg);
}

/* Allow text selection */
.cs-dialog .content {
  user-select: text;
}

p, h1, h2, h3, h4, h5, h6, pre, code, span, li, td, th {
  user-select: text;
}

button, .cs-btn, label, input {
  user-select: none;
}

fieldset {
  border: none !important;
  padding: 0;
  margin: 0;
}

.cs-input {
  width: 100%;
}

textarea.cs-input {
  font-family: monospace !important;
}

/* ==================
   LAYOUT COMPONENTS
   ================== */

/* Page containers - Fluid responsive layout */
.page-container-xl {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 40px;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .page-container-xl {
    padding: 20px 30px;
  }
}

@media (max-width: 768px) {
  .page-container-xl {
    padding: 15px 20px;
  }
}

/* Dialog overrides */
.dialog-static {
  position: relative;
  margin-bottom: 20px;
}

/* Headings */
.heading {
  background: var(--c-bg-card);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-dark);
}

.cs-dialog .heading {
  padding: 15px 20px;
  user-select: text;
}

.cs-dialog .heading .text,
.cs-dialog .heading span {
  user-select: text;
}

.heading-bold {
  font-weight: bold;
  color: var(--accent);
}

.heading-gold {
  color: #ffd700;
  font-weight: bold;
}

/* Site header (all pages) */
.home-title {
  color: var(--accent);
  font-size: 3em;
}

.home-title a {
  color: inherit;
  text-decoration: none;
}

.home-title a:hover {
  text-decoration: underline;
}

.home-title-link a {
  color: var(--accent);
  text-decoration: none;
}

/* Hide .com on mobile, show on desktop */
.home-title .desktop-only {
  display: inline;
}
.home-title .mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .home-title {
    font-size: 1.8em;
  }
  .home-title .desktop-only {
    display: none;
  }
  .home-title .mobile-only {
    display: inline;
  }
}

/* Site header grid */
.header-cta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .header-cta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Hide the long tagline on mobile */
  .header-cta-grid .grid-1fr-auto-auto-auto > p {
    display: none;
  }

  /* Stack the header controls */
  .header-cta-grid .grid-1fr-auto-auto-auto {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
  }
}

.language-select {
  min-width: 180px;
}

select.cs-select.language-select option {
  text-align: left;
}

.wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

/* Content areas */
.content {
  padding: 20px;
}

.content-selectable {
  user-select: text;
}

/* ==================
   PANELS
   ================== */
.panel {
  background: var(--c-bg-card);
  border: 1px solid var(--border-dark);
  margin-bottom: 20px;
}

.panel-header {
  padding: 15px 20px;
  font-weight: bold;
  border-bottom: 1px solid var(--border-dark);
  background: var(--c-bg-card-alt);
}

.panel-content {
  padding: 20px;
}

/* ==================
   DETAIL ROWS
   ================== */
.detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-dark);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--c-muted);
  font-size: 21px;
}

.detail-value {
  color: var(--c-white);
  font-size: 21px;
}

.detail-grid {
  display: grid;
  gap: 10px;
}

/* ==================
   BUTTONS (extending cs16)
   ================== */
.btn-small {
  padding: 5px 10px;
  font-size: 18px;
}

.btn-full {
  width: 100%;
}

/* ==================
   CTA BUTTONS (Gold)
   ================== */
.cta,
.btn-primary,
.btn-accent-black,
.cta-button,
.cta-download {
  background: var(--accent);
  color: var(--c-black);
  font-weight: bold;
  cursor: pointer;
}

.cta:hover,
.btn-primary:hover,
.btn-accent-black:hover,
.cta-button:hover,
.cta-download:hover {
  box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(196, 181, 80, 0.4);
}

.cta-lg {
  font-size: 30px;
  padding: 22px;
  display: block;
  text-align: center;
  text-decoration: none;
}

/* ==================
   BUTTON HOVER/ACTIVE STATES
   ================== */
.cs-btn:hover {
  background: var(--accent);
  color: var(--c-black);
  box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(196, 181, 80, 0.4);
}

.cs-btn:active {
  background: var(--accent);
  color: var(--c-black);
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(196, 181, 80, 0.3);
}

.cs-btn.btn-danger:hover {
  background: var(--c-error);
  color: var(--c-black);
  box-shadow: 0 0 12px var(--c-error), 0 0 24px rgba(255, 68, 68, 0.4);
}

.cs-btn.btn-danger:active {
  background: var(--c-error);
  color: var(--c-black);
  box-shadow: 0 0 8px var(--c-error), 0 0 16px rgba(255, 68, 68, 0.3);
}

/* ==================
   LINKS
   ================== */
.link-accent {
  color: var(--accent);
  text-decoration: none;
}

.link-accent:hover {
  text-decoration: underline;
}

/* ==================
   LISTS
   ================== */
.list-indented {
  padding-left: 20px;
}

.list-indented li {
  margin-bottom: 8px;
}

/* ==================
   TEXT UTILITIES (semantic)
   ================== */
.text-small {
  font-size: 18px;
  color: var(--c-muted);
}

.text-xs {
  font-size: 18px;
}

.text-xl {
  font-size: 24px;
}

.text-2xl {
  font-size: 30px;
}

/* ==================
   FEATURE LISTS
   ================== */
.feature-list {
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

/* ==================
   CODE BLOCKS
   ================== */
.code-block {
  background: var(--c-bg-card-alt);
  padding: 15px;
  border: 1px solid var(--border-dark);
  overflow-x: auto;
  font-family: monospace;
  font-size: 18px;
}

/* ==================
   FORMS
   ================== */
.console-form-field {
  margin-bottom: 15px;
}

.console-form-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--c-muted);
}

/* ==================
   LANDING PAGE
   ================== */
.landing-feature {
  background: var(--c-bg-green);
  border: 1px solid var(--border-dark);
  padding: 20px;
}

.landing-feature h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.landing-feature p {
  font-size: 18px;
  color: var(--c-white);
}

/* ==================
   DIALOG OVERRIDES
   ================== */
.dialog-static {
  position: static;
  margin-bottom: 20px;
  max-width: 100% !important;
}

.dialog-static-no-margin {
  position: static;
  min-width: 0;
}

.cs-dialog:has(.docs-grid-layout) {
  max-width: none;
  min-width: 0;
}

.cs-dialog .content.docs-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.docs-grid-layout pre,
.docs-grid-layout code,
.docs-grid-layout .code-block {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: normal;
  white-space: pre;
  box-sizing: border-box;
}

/* ==================
   PAGE HEADER/FOOTER
   ================== */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  margin-bottom: 10px;
}

.page-header p {
  margin-top: 10px;
}

.page-footer {
  width: 100%;
  max-width: 100%;
  margin: 0px auto 20px;
  padding: 20px 40px;
  text-align: center;
  border-top: 1px solid var(--accent);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .page-footer {
    padding: 15px 20px;
  }
}

.footer-links {
  display: grid;
  grid-auto-flow: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .footer-links {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(100px, auto));
  }
}

.footer-legal-links {
  display: grid;
  grid-auto-flow: column;
  gap: 20px;
  align-items: center;
  white-space: nowrap;
}

.footer-copyright {
  font-size: 20px;
  color: white;
}

.footer-tagline {
  font-style: italic;
  width: 100%;
  font-size: 20px;
  color: white;
}

.root-footer {
  font-size: 20px;
  color: white;
}

.root-footer-italic {
  font-style: italic;
  width: 100%;
  font-size: 20px;
  color: white;
}

/* ==================

/* ==================
   CODE STYLES
   ================== */
.code-inline {
  background: var(--secondary-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

pre {
  background: var(--secondary-bg);
  padding: 15px;
  border: 1px solid var(--border-dark);
  overflow-x: auto;
  font-size: 18px;
  max-width: 100%;
  word-wrap: normal;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

code {
  word-wrap: normal;
  white-space: pre;
}

pre, code {
  max-width: 100%;
  overflow-x: auto;
}

textarea.cs-input.code-input {
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace !important;
  font-size: 20px !important;
  line-height: 1.5 !important;
  tab-size: 4;
}

textarea.cs-input.prompt-input {
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace !important;
  font-size: 20px !important;
  line-height: 1.6 !important;
}

.textarea-no-resize {
  resize: none;
  overflow-y: auto;
}

.code-block-container {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-size: 18px;
  background: var(--accent);
  color: var(--c-black);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.code-block-container:hover .copy-button {
  opacity: 1;
}

.copy-button.copied {
  background: #4ade80 !important;
  opacity: 1 !important;
}

/* ==================
   TABLE STYLES
   ================== */
.table-docs {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 20px;
}

.table-docs tr {
  border-bottom: 1px solid var(--border-dark);
}

.table-docs th,
.table-docs td {
  text-align: left;
  padding: 8px;
}

.table-docs a {
  color: #c4b550;
  text-decoration: none;
}

.table-docs a:hover {
  color: var(--c-white);
  text-decoration: underline;
}

/* ==================
   FLASH MESSAGES
   ================== */
.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 15px;
  width: calc(100vw - 40px);
  max-width: 400px;
}

.flash-error {
  background: var(--c-bg-card-alt);
  border: 2px solid #ff4444;
}

.flash-error .heading {
  background: #ff4444;
  color: var(--c-black);
  position: relative;
}

.flash-info {
  background: var(--c-bg-card-alt);
  border: 2px solid var(--accent);
}

.flash-info .heading {
  background: var(--accent);
  color: var(--c-black);
  position: relative;
}

.flash-close-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--c-black);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: grid;
  align-items: center;
  justify-items: center;
}

.grid-4col-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 250px));
  gap: 20px;
  justify-content: center;
}

/* ==================
   BUTTON EXTENSIONS
   ================== */
a.cs-btn {
  text-decoration: none;
  display: grid;
  align-items: center;
  justify-items: center;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.btn-inline {
  display: inline-block;
  text-decoration: none;
  color: var(--c-white);
}

.btn-accent-black-full {
  width: 100%;
}

.btn-link-accent {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.btn-nowrap {
  white-space: nowrap;
}

.btn-margin-right-10 {
  margin-right: 10px;
}

.btn-danger {
  background-color: #aa2222 !important;
  border-color: #ff4444 !important;
}

.btn-danger:hover {
  background-color: #cc2222 !important;
}

.btn-danger:disabled {
  background-color: #444 !important;
  border-color: #666 !important;
  color: #888 !important;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-execute {
  font-size: 2em;
  padding: 15px 30px;
  border: 2px solid var(--accent);
  background-color: rgba(255, 215, 0, 0.1);
  color: #fff !important;
}

.btn-execute .emoji-small {
  font-size: 0.6em;
}

.btn-cancel {
  font-size: 2em;
  padding: 15px 30px;
  background: #aa2222;
  border-color: var(--c-error);
}

.btn-share {
  padding: 10px 20px;
  background: #334455;
  border-color: #557799;
}

.btn-share:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cta-button,
.cta-download {
  display: block;
  font-size: 30px;
  padding: 22px;
  text-align: center;
  text-decoration: none;
}

.cta-download {
  border: 1px solid;
  border-color: var(--border-light) var(--border-dark) var(--border-dark) var(--border-light);
  line-height: 15px;
}

/* ==================
   BORDER UTILITIES
   ================== */
.border-top-accent {
  border-top: 1px solid var(--accent);
}

.border-divider {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--accent);
}

.border-2-accent {
  border: 2px solid var(--accent);
}

.border-1-444 {
  border: 1px solid #444;
}

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 768px) {
  .page-container-xl {
    padding: 10px;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }

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

  .cs-dialog .content.docs-grid-layout {
    grid-template-columns: 1fr !important;
  }

  .page-footer p {
    white-space: normal !important;
  }

  pre {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: normal !important;
    white-space: pre !important;
    -webkit-overflow-scrolling: touch !important;
  }

  code {
    word-wrap: normal !important;
    white-space: pre !important;
  }

  .cs-dialog .content {
    overflow-x: hidden !important;
  }

  .content-selectable {
    overflow-x: hidden !important;
  }

  .grid-4col-auto {
    grid-template-columns: 1fr 1fr !important;
  }

  .docs-grid-layout {
    grid-template-columns: 1fr !important;
  }
}
