/* public/assets/css/layout.css */

/* Layout: header / subheader / footer / shell */

:root{
  /* darker + more "black-blue" */
  --ui-frame:  #03060B; /* header/subheader/footer */
  --ui-side:   #060A12; /* left/right rails */
  --ui-canvas: #0A101C; /* center canvas */

  /* subtle dividers (cleaner, TradingView-like) */
  --ui-line: rgba(255,255,255,.035);
  --ui-line-strong: rgba(255,255,255,.055);
}

/* =========================
   LANDING FIX (scoped)
   ========================= */
body.st-body.is-landing{
  /* landing must be darker than canvas */
  --ui-side:   #060A12;
  --ui-canvas: #060A12;
  background: var(--ui-canvas);
}

/* make landing header feel like workspace: full-width inner */
body.st-body.is-landing .st-header-top,
body.st-body.is-landing .st-subheader-inner{
  max-width: none;
  margin: 0;
  padding-left: 24px;
  padding-right: 24px;
}

/* optional: slightly tighter on small screens */
@media (max-width: 700px){
  body.st-body.is-landing .st-header-top{
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Main */
.st-main{
  flex: 1 0 auto;
  padding-top: 40px;
  padding-bottom: 80px;
  min-height: 90vh;
}

/* Container */
.st-shell{
  flex: 1;
  display: flex;
  flex-direction: column;

  max-width: var(--st-shell-max-width);
  margin: 0 auto;
  padding: 24px 20px 32px;
}

/* Topbar (header + subheader as one strip) */
.st-topbar{
  position: sticky;
  top: 0;
  z-index: 120;

  width: 100%;
  background: var(--ui-frame);

  border-bottom: 1px solid var(--ui-line);
}

/* Spacer so content never slides under sticky topbar */
.st-topbar-offset{
  height: var(--st-topbar-h, 0px);
}

/* Sticky safety */
.st-body,
.st-shell,
.st-main{
  overflow: visible;
}

/* Divider between header row and subheader row */
.st-topbar-divider{
  height: 1px;
  background: var(--ui-line-strong);
}

/* Header */
.st-header{
  position: static;
  top: auto;
  z-index: auto;

  width: 100%;
  padding: 0;

  background: transparent;
  border: 0;
}

.st-header-top{
  width: 100%;
  max-width: var(--st-shell-max-width);
  margin: 0 auto;
  padding: 14px 20px;

  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 18px;

  background: transparent;
  border: 0;
  border-radius: 0;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  box-shadow: none;

  animation: st-header-appear .45s ease-out;
}

@keyframes st-header-appear{
  from{ opacity: 0; transform: translateY(-6px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* Logo */
.st-logo{
  display: inline-flex;
  align-items: center;
  gap: 12px;

  text-decoration: none !important;
  white-space: nowrap;
  min-width: 0;
}

.st-logo-img{
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.98;

  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.55));
}

.st-header .st-logo-text{
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.95) !important;
}

.st-header .st-logo:hover .st-logo-text{
  color: rgba(255,255,255,1) !important;
}

.st-body--guest .st-logo-img{ height: 40px; }
.st-body--guest .st-header .st-logo-text{ font-size: 20px; }

/* Nav */
.st-nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;

  font-size: 14px;
  min-width: 0;
}

.st-nav a{
  color: rgba(226,232,240,0.72);
  text-decoration: none !important;

  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;

  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.st-nav a:hover{
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.04);
}

.st-nav a.is-active{
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.06);
  border-color: rgba(148,163,184,0.14);
}

/* Right area */
.st-header-right{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  min-width: 0;
}

/* Auth */
.st-header-auth{
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.st-header-auth a,
.st-header-right a{
  text-decoration: none !important;
}

.st-header-login{
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;

  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.55),
    0 0 14px rgba(255, 255, 255, 0.35);

  transition: text-shadow .2s ease, opacity .2s ease;
}

.st-header-login:hover{
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.8),
    0 0 18px rgba(255, 255, 255, 0.45);
  opacity: 0.92;
}

.st-header-signup{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 0 18px;

  font-size: 14px;
  font-weight: 650;
  color: #ffffff;

  background: linear-gradient(90deg, #0cc0df, #004aad);
  border-radius: 10px;

  transition: box-shadow .25s ease, transform .18s ease, opacity .2s ease;
}

.st-header-signup:hover{
  transform: translateY(-1px);
  opacity: 0.96;
  box-shadow:
    0 0 14px rgba(56, 189, 248, 0.24),
    0 0 26px rgba(29, 78, 216, 0.20);
}

.st-header-signup:active{
  transform: scale(0.98);
  opacity: 0.88;
}

/* Buttons */
.st-header-btn{
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;

  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(255,255,255,0.03);
  color: rgba(226,232,240,0.90);

  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.st-header-btn:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(148,163,184,0.28);
  color: rgba(255,255,255,0.95);
}

.st-header-btn--admin{
  color: rgba(200,214,255,0.95);
  border-color: rgba(120,150,255,0.35);
  background: rgba(120,150,255,0.10);
}

.st-header-btn--admin:hover{
  background: rgba(120,150,255,0.16);
}

.st-header-btn--logout{
  color: rgba(226,232,240,0.86);
}

/* User chip */
.st-user{
  display: inline-flex;
  align-items: center;
  gap: 12px;

  height: 40px;
  padding: 0 12px;
  border-radius: 14px;

  color: rgba(226,232,240,0.92);

  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(255,255,255,0.03);

  min-width: 0;
}

.st-user:hover{
  background: rgba(255,255,255,0.06);
}

.st-user-email{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.st-user-avatar{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(255,255,255,0.06);
}

.st-user-initial{
  font-size: 13px;
  font-weight: 850;
  opacity: 0.95;
}

/* Subheader */
.st-subheader{
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
}

.st-subheader-inner{
  width: 100%;
  max-width: var(--st-shell-max-width);
  margin: 0 auto;
  padding: 10px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.st-subheader-left,
.st-subheader-right{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Footer */
.st-footer-outer{
  width: 100%;
  margin-top: auto;
  padding: 40px 0 32px;

  background: var(--ui-frame);
  border-top: 1px solid var(--ui-line);
}

.st-footer-shell{
  max-width: var(--st-shell-max-width);
  margin: 0 auto;
  padding: 32px 72px 26px;

  display: flex;
  flex-direction: column;
  gap: 22px;
}

.st-footer-main{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
}

.st-footer-col--disclaimer{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;

  font-size: 13px;
  padding-left: 40px;
}

.st-footer-col--disclaimer::before{
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 1px;

  background: linear-gradient(
    to bottom,
    rgba(148, 163, 184, 0),
    rgba(148, 163, 184, 0.5),
    rgba(148, 163, 184, 0)
  );
  opacity: 0.9;
}

.st-footer-logo{
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--st-text);
}

.st-footer-tagline{
  margin-top: 4px;
  font-size: 14px;
  color: var(--st-text-muted);
}

.st-footer-email{
  margin-top: 6px;
  font-size: 14px;
  color: var(--st-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.st-footer-email:hover{ color: var(--st-accent); }

.st-footer-social{
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.st-social-btn{
  width: 34px;
  height: 34px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.04);
  color: var(--st-text);
}

.st-social-btn:hover{
  transform: translateY(-1px);
  border-color: var(--st-accent);
}

.st-footer-text{
  margin: 0;
  line-height: 1.6;
  color: var(--st-text-muted);
}

.st-footer-bottom{
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-top: 14px;
  margin-top: 24px;

  font-size: 12px;
  color: var(--st-text-muted);
}

.st-footer-bottom::before{
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  width: 100vw;
  height: 1px;
  background: rgba(148, 163, 184, 0.24);
}

/* Responsive */
@media (max-width: 900px){
  .st-header-top{ padding: 12px 16px; gap: 12px; }
  .st-subheader-inner{ padding: 10px 16px; }
  .st-user-email{ max-width: 180px; }
  .st-nav{ gap: 10px; }

  .st-footer-shell{ padding: 24px 20px; }

  .st-footer-main{
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .st-footer-col--disclaimer{ padding-left: 0; }
  .st-footer-col--disclaimer::before{ display: none; }

  .st-footer-bottom{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 700px){
  .st-user-email{ display: none; }
  .st-logo-img{ height: 32px; }
  .st-header .st-logo-text{ font-size: 16px; }
  .st-header-btn{ padding: 0 10px; }
}

@media (max-width: 600px){
  .st-header-top{ padding: 10px 12px; }
  .st-subheader-inner{ padding: 10px 12px; }

  .st-nav{
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .st-nav::-webkit-scrollbar{ display: none; }

  .st-footer-shell{
    padding: 22px 16px;
    gap: 18px;
  }

  .st-footer-text{ font-size: 12px; }
}

/* Workspace overrides */
.st-body.is-workspace .st-header-top,
.st-body.is-workspace .st-subheader-inner{
  max-width: none;
  margin: 0;
  padding-left: 16px;
  padding-right: 16px;
}

.st-body.is-workspace .st-main--workspace{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
