/* style.css – Globale Styles, CSS-Variablen, Layout für eDuCollector */

/* ===== LOKALE SCHRIFTEN (offline-fähig) ===== */
@import url('./fonts.css');

/* ===== CSS-VARIABLEN ===== */
:root {
  --primary: #1a7fa8;
  --primary-dark: #145f80;
  --primary-light: #e8f4f9;
  --accent: #f0a500;
  --accent-dark: #c88800;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e6ea;

  --text: #1a1d23;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --nav-height: 64px;
  --header-height: 60px;
  --fab-size: 64px;
  --touch-target: 48px;

  --font-headline: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #1a1d26;
    --surface-2: #22263a;
    --border: #2d3348;

    --text: #e8eaf0;
    --text-muted: #9ca3b8;
    --text-light: #6b7280;

    --primary-light: #0d3a4f;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.35), 0 10px 10px rgba(0,0,0,0.25);
  }
}

/* ===== RESET & BASIS ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
}

ul, ol {
  list-style: none;
}

/* ===== LAYOUT ===== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
  flex: 1;
}

.app-header .logo img,
.app-header .logo svg {
  width: 32px;
  height: 32px;
}

.app-header .logo span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main {
  flex: 1;
  padding-bottom: calc(var(--nav-height) + 16px);
}

.tab-content {
  display: none;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-height: var(--touch-target);
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  transform: scale(1.1);
}

.nav-item:hover {
  color: var(--primary);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== FORMULARE ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 127, 168, 0.12);
}

.form-control::placeholder {
  color: var(--text-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ===== QUICK INPUT ===== */
.quick-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.quick-input {
  width: 100%;
  padding: 16px 52px 16px 16px;
  font-size: 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.quick-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26, 127, 168, 0.1), var(--shadow-md);
}

.quick-input-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}

.quick-input-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.05);
}

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 12px 16px;
  font-size: 0.72rem;
  color: var(--text-light);
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-bottom: var(--nav-height);
  line-height: 1.8;
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.app-footer a:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .tab-content {
    padding: 24px;
    max-width: 720px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .tab-content {
    max-width: 900px;
  }
}
