/* ═══════════════════════════════════════════════════════════
   TTH Links – Dark/Red IT-Dashboard Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── CSS-Variablen ─────────────────────────────────────── */
:root {
  --bg:          #121212;
  --bg-elevated: #1e1e1e;
  --bg-card:     #242424;
  --bg-card-hover: #2c2c2c;
  --border:      #2e2e2e;
  --border-focus:#444;

  --accent:      #e50914;
  --accent-hover:#ff1a26;
  --accent-dim:  rgba(229, 9, 20, 0.15);

  --text-primary:   #f0f0f0;
  --text-secondary: #9a9a9a;
  --text-muted:     #5c5c5c;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 2px 12px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 3px rgba(229, 9, 20, 0.25);
  --transition: 0.18s ease;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── Logo ──────────────────────────────────────────────── */
.logo-tth {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.logo-links {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 2px;
}

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES (Setup & Login)
   ═══════════════════════════════════════════════════════════ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(229, 9, 20, 0.12) 0%, transparent 70%),
    var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ─── Formular ──────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.65rem 1.2rem;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-card);
}

.btn-full { width: 100%; justify-content: center; margin-top: 0.5rem; }

/* ─── Alert ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.alert-error {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #ff6b6b;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════ */
.dashboard-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ────────────────────────────────────────────── */
.header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.header-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
}

.logout-form { margin: 0; }

/* ─── Main ──────────────────────────────────────────────── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  letter-spacing: 0;
  text-transform: none;
}

/* ─── Add Section ───────────────────────────────────────── */
.add-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.25rem;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .add-form-fields { grid-template-columns: 1fr; }
}

/* ─── Links Grid ────────────────────────────────────────── */
.links-section { }

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ─── Link Card ─────────────────────────────────────────── */
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform var(--transition);
  transform-origin: bottom;
}

.link-card:hover {
  border-color: rgba(229, 9, 20, 0.45);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.link-card:hover::before {
  transform: scaleY(1);
}

.link-card-anchor {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.85rem 1rem 1.1rem;
  min-width: 0;
  color: inherit;
}

.link-card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.link-card-icon img { display: block; }

.link-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.15rem;
}

.link-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-url {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}

.link-card:hover .link-card-arrow {
  opacity: 1;
  color: var(--accent);
}

/* ─── Delete Button ─────────────────────────────────────── */
.delete-form { flex-shrink: 0; padding-right: 0.75rem; }

.btn-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.btn-delete:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-state svg { opacity: 0.4; }

.empty-state p {
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
