/* ==========================================================================
   LAYOUT – Header, Sidebar, Main, Footer, Mobile nav
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Top header
   -------------------------------------------------------------------------- */
.st-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: 0 var(--sp-8);
  background-color: rgba(11, 19, 38, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--glow-header);
  font-family: var(--font-headline);
  letter-spacing: -0.02em;
}

/* Brand / logo */
.st-header__brand {
  flex-shrink: 0;
}
.st-brand__name {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--primary-container);
  white-space: nowrap;
}
.st-brand__logo-link { display: block; }
.st-brand__logo-img { width: 160px; max-width: 160px; height: auto; display: block; }

.st-brand__name:hover {
  color: var(--primary);
}

/* Top navigation */
.st-header__nav {
  display: none;
  align-items: center;
  gap: var(--sp-8);
}
@media (min-width: 768px) {
  .st-header__nav {
    display: flex;
  }
}
.st-header__nav a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--outline);
  transition: color var(--t-base);
  white-space: nowrap;
}
.st-header__nav a:hover,
.st-header__nav a.is-active {
  color: var(--primary);
}

/* Header tools (search + CTA) */
.st-header__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-shrink: 0;
}

/* Search box */
.st-search {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  background-color: var(--surface-container-highest);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
}
@media (min-width: 1024px) {
  .st-search {
    display: flex;
  }
}
.st-search__icon {
  font-size: 1.1rem;
  color: var(--outline);
}
.st-search__input {
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--text-sm);
  color: var(--on-surface);
  width: 9rem;
}
.st-search__input::placeholder {
  color: var(--outline);
}

/* Credit badge */
.st-credit-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container-highest);
  border: 1px solid rgba(0, 220, 229, 0.25);
  color: var(--tertiary, #00dce5);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.st-credit-badge .material-symbols-outlined {
  font-size: 1rem;
}
.st-credit-badge__count {
  font-family: var(--font-headline, 'Space Grotesk', sans-serif);
  font-size: 0.95rem;
}
.st-credit-badge__label {
  font-size: 0.75rem;
  opacity: 0.8;
}
.st-credit-badge:hover {
  background: var(--surface-container-high);
  border-color: var(--tertiary, #00dce5);
  color: var(--tertiary, #00dce5);
}
.st-credit-badge--empty {
  border-color: rgba(255, 180, 171, 0.3);
  color: var(--error, #ffb4ab);
}
.st-credit-badge--empty:hover {
  border-color: var(--error, #ffb4ab);
  color: var(--error, #ffb4ab);
}

/* Hamburger (mobile) */
.st-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  color: var(--on-surface-variant);
  transition: background var(--t-base), color var(--t-base);
}
.st-hamburger:hover {
  background: var(--surface-container-highest);
  color: var(--primary);
}
@media (min-width: 1024px) {
  .st-hamburger {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   2. Sidebar
   -------------------------------------------------------------------------- */
.st-sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  width: var(--sidebar-width);
  background-color: var(--surface-container-low);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) 0;
  z-index: 40;
  overflow-y: auto;
  scrollbar-width: none;
  transition: transform var(--t-base);
}
.st-sidebar::-webkit-scrollbar { display: none; }

@media (max-width: 1023px) {
  .st-sidebar {
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .st-sidebar.is-open {
    transform: translateX(0);
  }
}

/* Sidebar overlay (mobile) */
.st-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(6, 14, 32, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--t-base);
}
.st-sidebar-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* Sidebar profile */
.st-sidebar__profile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-6) var(--sp-8);
}
.st-sidebar__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-variant);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(184, 195, 255, 0.15);
}
.st-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.st-sidebar__console-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--on-surface);
}
.st-sidebar__version {
  font-size: var(--text-xs);
  color: var(--outline);
}

/* Subscription status widget */
.st-sidebar__sub-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  margin: 8px 0 4px;
  background: var(--surface-container-low, #131b2e);
  border-radius: 10px;
  border: 1px solid var(--outline-variant, #434656);
}
.st-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
}
.st-sub-badge .material-symbols-outlined { font-size: 0.95rem; }
.st-sub-badge--active   { color: #80e8a0; }
.st-sub-badge--cancelling { color: #ffcc80; }
.st-sub-badge--free     { color: var(--primary, #b8c3ff); }
.st-sub-manage {
  font-size: var(--text-xs);
  color: var(--outline);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.st-sub-manage:hover { color: var(--primary, #b8c3ff); }

/* Sidebar nav – rendered by Drupal menu block */
.st-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.st-sidebar__nav .menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.st-sidebar__nav .menu__item a,
.st-sidebar__nav .menu__item button {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-base);
  color: var(--outline);
  width: 100%;
  text-align: left;
  border-right: 4px solid transparent;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
  font-family: var(--font-body);
}
.st-sidebar__nav .menu__item a:hover {
  background-color: var(--surface-variant);
  color: var(--on-surface-variant);
}
.st-sidebar__nav .menu__item.is-active > a,
.st-sidebar__nav .menu__item a.is-active {
  background-color: rgba(46, 91, 255, 0.10);
  color: var(--tertiary);
  border-right-color: var(--tertiary);
}

/* Sidebar section labels */
.st-sidebar__nav .menu__section-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-6) var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--outline);
  opacity: 0.6;
}
.st-sidebar__nav .menu__section-label .material-symbols-outlined {
  font-size: 1rem;
}
.st-sidebar__nav .menu__section-label--admin {
  color: var(--tertiary);
  opacity: 0.8;
}
/* Child items: indented with left border to show hierarchy */
.st-sidebar__nav .menu__item--child > a {
  padding-left: calc(var(--sp-6) + var(--sp-4));
  font-size: var(--text-sm);
  border-left: 2px solid rgba(184, 195, 255, 0.25);
  margin-left: var(--sp-4);
  border-radius: 0 8px 8px 0;
  color: var(--on-surface-variant);
}
.st-sidebar__nav .menu__item--child > a:hover {
  border-left-color: rgba(184, 195, 255, 0.6);
  color: var(--on-surface);
}
.st-sidebar__nav .menu__item--child.is-active > a,
.st-sidebar__nav .menu__item--child > a.is-active {
  border-left-color: var(--tertiary);
  color: var(--tertiary);
}
.st-sidebar__nav .menu__item--child > a .material-symbols-outlined {
  font-size: 1.1rem;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   3. Main content area
   -------------------------------------------------------------------------- */
.st-main {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100dvh;
}
@media (max-width: 1023px) {
  .st-main {
    margin-left: 0;
    padding-bottom: 4.5rem; /* room for bottom nav */
  }
}

/* Content region wrapper */
.st-content {
  width: 100%;
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */
.st-footer {
  background-color: var(--bg);
  border-top: 1px solid rgba(67, 70, 86, 0.15);
  padding: var(--sp-12) 0;
}
.st-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--sp-8);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
@media (max-width: 639px) {
  .st-footer__inner {
    grid-template-columns: 1fr;
  }
}
.st-footer__logo {
  display: block;
  height: 32px;
  width: auto;
  margin-bottom: var(--sp-2);
}
.st-footer__copy {
  color: var(--outline);
}
.st-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  justify-content: flex-end;
}
@media (max-width: 639px) {
  .st-footer__links {
    justify-content: flex-start;
  }
}
.st-footer__links a {
  color: var(--on-surface-variant);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-base);
}
.st-footer__links a:hover {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   5. Mobile bottom navigation
   -------------------------------------------------------------------------- */
.st-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 4rem;
  background-color: rgba(11, 19, 38, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(67, 70, 86, 0.10);
  justify-content: space-around;
  align-items: center;
}
@media (max-width: 767px) {
  .st-bottom-nav {
    display: flex;
  }
}
.st-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--outline);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  transition: color var(--t-base);
  padding: var(--sp-2);
}
.st-bottom-nav__item .material-symbols-outlined {
  font-size: 1.5rem;
}
.st-bottom-nav__item.is-active,
.st-bottom-nav__item:hover {
  color: var(--tertiary);
}

/* --------------------------------------------------------------------------
   6. Page inner layout
   -------------------------------------------------------------------------- */
.layout-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--sp-8);
  width: 100%;
}
@media (max-width: 639px) {
  .layout-container {
    padding: 0 var(--sp-4);
  }
}

/* Drupal local tasks (tabs) */
.st-local-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-3) var(--sp-8);
  border-bottom: 1px solid rgba(67, 70, 86, 0.20);
  list-style: none;
  margin: 0;
}
.st-local-tasks li {
  display: flex;
  align-items: center;
  list-style: none;
}
.st-local-tasks a {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--outline);
  font-weight: 500;
  transition: background var(--t-base), color var(--t-base);
  white-space: nowrap;
}
.st-local-tasks a:hover,
.st-local-tasks a.is-active {
  background: var(--surface-container-high);
  color: var(--primary);
}

/* Action links */
.action-links {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-8);
}
.action-links a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--tertiary);
  border: 1px solid rgba(0, 220, 229, 0.25);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius);
  transition: background var(--t-base);
}
.action-links a:hover {
  background: rgba(0, 220, 229, 0.08);
  color: var(--tertiary);
}

/* Material Symbols – rezervace prostoru před načtením fontu */
.material-symbols-outlined {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
}
.st-service-card__icon .material-symbols-outlined {
  font-size: 2rem;
  min-width: 2rem;
  min-height: 2rem;
}


/* Subscription badge */
.st-sub-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-container-highest);
  border: 1px solid rgba(76, 175, 80, 0.25);
  color: var(--success, #4caf50);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  margin-right: 8px;
}
.st-sub-badge .material-symbols-outlined {
  font-size: 1rem;
}
.st-sub-badge__text {
  font-size: 0.85rem;
}
.st-sub-badge:hover {
  background: var(--surface-container-high);
  border-color: var(--success, #4caf50);
  color: var(--success, #4caf50);
}
.st-sub-badge--inactive {
  border-color: rgba(255, 152, 0, 0.25);
  color: var(--warning, #ff9800);
}
.st-sub-badge--inactive:hover {
  border-color: var(--warning, #ff9800);
  color: var(--warning, #ff9800);
}
