﻿/* M3GIM Base Styles - Reset, Typography, Layout */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-3xl); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-lg); font-weight: var(--weight-medium); }

a {
  color: var(--color-kug-blau);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* App Shell */
.app-header {
  background: var(--color-kug-blau);
  color: var(--color-text-inverse);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-6);
  flex-shrink: 0;
}

.app-header__title,
.app-header__brand {
  font-family: var(--font-title);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  color: var(--color-text-inverse);
  text-decoration: none;
}

.app-header__brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.app-header__subtitle {
  font-size: var(--text-sm);
  opacity: 0.8;
}

.app-header__spacer {
  flex: 1;
}

.app-header__nav {
  display: flex;
  gap: var(--space-4);
}

.app-header__nav a {
  color: var(--color-text-inverse);
  opacity: 0.75;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.app-header__nav a:hover {
  opacity: 1;
  text-decoration: none;
}

.app-header__nav a.active {
  opacity: 1;
  border-bottom: 2px solid var(--color-text-inverse);
  padding-bottom: 2px;
}

#main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.app-footer {
  background: var(--color-cream);
  border-top: 1px solid var(--border-color);
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.app-footer a {
  color: var(--color-text-secondary);
}

/* Research Preview Badge (in header) */
.app-header__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.app-header__badge:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

/* Tab Content Sections — absolute fill so height: 100% resolves reliably */
.tab-content {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
  background: var(--color-sand);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* Focus — keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--color-kug-blau);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--color-kug-blau);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-kug-blau);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selection */
::selection {
  background: var(--color-gold-light);
  color: var(--color-text-primary);
}
