@import "/src/components/LandingComponent.css";
@import "/src/components/CardComponent.css";
@import "/src/components/CreateStoryPopupComponent.css";
@import "/src/components/HeaderComponent.css";
@import "/src/components/SearchBarAndInfoTagsComponent.css";
@import "/src/components/StoryComponent.css";
@import "/src/controllers/BoardPageComponent.css";

/* ============================================
   ZIELBOARD — Modern Dark Theme
   ============================================ */

:root {
  --bg-primary: #1a1d21;
  --bg-secondary: #22262b;
  --bg-tertiary: #2a2f35;
  --bg-card: #2e3339;
  --bg-hover: #353b42;
  --bg-input: #353b42;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(99, 179, 237, 0.3);

  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --text-accent: #63b3ed;
  --text-warm: #f6ad55;

  --accent-blue: #4299e1;
  --accent-green: #48bb78;
  --accent-orange: #ed8936;
  --accent-red: #fc8181;
  --accent-yellow: #f6e05e;
  --accent-purple: #b794f4;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(66, 153, 225, 0.15);

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

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --column-gap: 12px;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 0;
  margin: 0;
  height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
}

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

a:hover {
  color: #90cdf4;
}

::selection {
  background: rgba(66, 153, 225, 0.3);
  color: var(--text-primary);
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.u-float-left {
  float: left;
}

.u-float-right {
  float: right;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
  background: var(--bg-secondary);
  height: var(--header-height);
  z-index: 999;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
}

nav > ul {
  padding: 0;
  margin: 0;
  margin-left: auto;
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

nav ul li {
  margin: 0;
  display: inline-block;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

nav > ul > li > a {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

nav > ul > li > a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Dropdown — padding-top keeps hover hitbox connected across the gap */
nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: transparent;
  padding-top: 8px;
  min-width: 200px;
  z-index: 1000;
}

nav ul ul::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: -1;
}

nav ul ul li {
  padding: 3px 6px;
}

nav ul li:hover > ul {
  display: block;
  animation: dropdownFade 200ms ease;
}

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

nav ul ul li {
  display: block;
  position: relative;
  min-width: unset;
  border-radius: var(--radius-sm);
}

nav ul ul li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

nav ul ul li:hover {
  background: var(--bg-hover);
}

nav ul ul ul {
  position: absolute;
  top: 0;
  left: 100%;
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-container {
  max-width: 420px;
  margin: 80px auto;
  padding: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.auth-container h1 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  box-sizing: border-box;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.auth-field input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.auth-container button {
  width: 100%;
  padding: 12px;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.auth-container button:hover {
  background: #3182ce;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-container button:active {
  transform: translateY(0);
}

.auth-error {
  color: var(--accent-red);
  margin-bottom: 12px;
  font-size: 0.875rem;
  padding: 10px 14px;
  background: rgba(252, 129, 129, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(252, 129, 129, 0.2);
}

.auth-error:empty {
  display: none;
}

.auth-link {
  margin-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-link a {
  color: var(--text-accent);
  font-weight: 500;
}

/* Auth brand header */
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.auth-brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Input hover state */
.auth-field input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ============================================
   REALM LIST
   ============================================ */

.realm-list-container {
  max-width: 640px;
  margin: 40px auto;
  padding: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.realm-list-container h1 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.create-realm-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.create-realm-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.create-realm-form input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.create-realm-form button {
  padding: 10px 20px;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.create-realm-form button:hover {
  background: #3182ce;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.realm-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.realm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.realm-item:hover {
  background: var(--bg-hover);
}

.realm-item + .realm-item {
  border-top: 1px solid var(--border-subtle);
}

.realm-link {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.realm-link:hover {
  color: var(--text-accent);
  text-decoration: none;
}

.realm-delete {
  background: none;
  border: 1px solid rgba(252, 129, 129, 0.3);
  color: var(--accent-red);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.realm-delete:hover {
  background: rgba(252, 129, 129, 0.15);
  border-color: var(--accent-red);
}

.realm-empty {
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.realm-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -16px;
  margin-bottom: 24px;
}

.realm-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.15), rgba(72, 187, 120, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.realm-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
