:root {
  --ia-bg: #f8fafc;
  --ia-surface: #ffffff;
  --ia-border: #e2e8f0;
  --ia-text: #0f172a;
  --ia-muted: #64748b;
  --ia-accent: #10b981;
  --ia-accent-hover: #059669;
  --ia-accent-light: rgba(16, 185, 129, 0.1);
  color-scheme: light;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  margin: 0;
  font-family: var(--font-sans, "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  background-color: var(--ia-bg);
  color: var(--ia-text);
  line-height: 1.5;
  width: 100%;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ia-surface);
  border-bottom: 1px solid var(--ia-border);
}

.shell-nav {
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
}

.shell-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ia-text);
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ia-accent);
  color: #fff;
}

.brand-mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ia-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--ia-text);
  background: #f1f5f9;
}

.nav-link.active {
  color: var(--ia-accent);
  background: var(--ia-accent-light);
}

.nav-center {
  flex: 1;
  max-width: 20rem;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-icon {
  position: absolute;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--ia-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

[dir="ltr"] .nav-search-icon {
  right: auto;
  left: 0.75rem;
}

.nav-search-input {
  width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--ia-border);
  background: #f1f5f9;
  color: var(--ia-text);
  text-align: right;
}

[dir="ltr"] .nav-search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  text-align: left;
}

.nav-search-input:focus {
  outline: none;
  border-color: var(--ia-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ia-accent-light);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-login {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ia-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.btn-login:hover {
  color: var(--ia-text);
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ia-muted);
  background: transparent;
  border: 1px solid var(--ia-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-lang:hover {
  color: var(--ia-text);
  background: #f1f5f9;
  border-color: var(--ia-muted);
}

.icon-lang {
  width: 1rem;
  height: 1rem;
}

.btn-signup {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ia-accent);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.btn-signup:hover {
  background: var(--ia-accent-hover);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#pageFrame {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
}

.shell-footer {
  padding: 1.5rem;
  background: #fff;
  border-top: 1px solid var(--ia-border);
}

.shell-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--ia-muted);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .shell-nav-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: 
      "brand auth"
      "search search"
      "links links";
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .brand {
    grid-area: brand;
    order: 1;
  }

  .nav-auth {
    grid-area: auth;
    order: 2;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .nav-center {
    grid-area: search;
    order: 3;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .nav-links {
    grid-area: links;
    order: 4;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.25rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0.25rem;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .btn-signup {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .btn-login {
    font-size: 0.8rem;
  }

  .shell-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}
