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

:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #11141b;
  --bg-card: rgba(22, 26, 37, 0.6);
  --bg-input: #1b202e;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-authentik: #fd4b2d;
  --accent-authentik-hover: #ff6a52;
  --accent-roblox: #00a2ff;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(253, 75, 45, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.04) 0px, transparent 50%);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Authentication Screen */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  background: radial-gradient(circle at center, #11141b 0%, #0a0c10 100%);
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  animation: fadeIn 0.6s ease-out;
}

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

.auth-logo {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-authentik) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.btn-authentik-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--accent-authentik);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
}

.btn-authentik-login:hover {
  background: var(--accent-authentik-hover);
  transform: translateY(-2px);
}

.btn-authentik-login:active {
  transform: translateY(0);
}

.auth-footer {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* App Shell Layout */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.app-shell.active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.sidebar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-authentik) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 40px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-item:hover, .menu-item.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.menu-item.active {
  border-left: 3px solid var(--accent-authentik);
}

.menu-item svg {
  width: 20px;
  height: 20px;
}

/* Initials / Letter Badges (Replaced Avatar Images) */
.user-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-authentik) 0%, var(--accent-purple) 100%);
  border: 1px solid var(--border-color);
}

.initials-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-roblox) 100%);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-displayname {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-username {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-logout:hover {
  color: var(--accent-red);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.content-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tab-pane {
  display: none;
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  height: 100%;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-pane.idea-board-pane {
  height: calc(100vh - 120px);
}

.idea-board-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  min-height: 0;
  flex: 1;
}

.idea-board-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.idea-board-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  outline: none;
  padding-bottom: 10px;
}

.idea-board-title-input:disabled {
  opacity: 0.6;
}

.idea-board-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  width: 100%;
}

.idea-board-toolbar-end {
  margin-left: auto;
}

.idea-board-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.idea-board-toolbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-danger-outline {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.idea-board-toolbar .btn-primary,
.idea-board-toolbar .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.idea-board-color-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-input);
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  height: 36px;
  box-sizing: border-box;
  flex-shrink: 0;
  color-scheme: dark;
}

.idea-board-color-picker label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.idea-board-color-picker input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: transparent;
  width: 28px;
  height: 28px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.idea-board-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.idea-board-color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.idea-board-color-picker input[type="color"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.idea-board-color-picker .idea-board-hex-input {
  width: 72px;
  height: 24px;
  padding: 0 6px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background-color: #0a0c10;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 22px;
  outline: none;
  text-transform: lowercase;
  box-sizing: border-box;
  flex-shrink: 0;
  color-scheme: dark;
}

.idea-board-color-picker .idea-board-hex-input:focus {
  border-color: var(--accent-authentik);
  background-color: #0a0c10;
}

.idea-board-color-picker .idea-board-hex-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #0a0c10;
}

.idea-board-color-picker .idea-board-hex-input::placeholder {
  color: var(--text-muted);
}

.idea-board-color-picker .idea-board-hex-input:-webkit-autofill,
.idea-board-color-picker .idea-board-hex-input:-webkit-autofill:hover,
.idea-board-color-picker .idea-board-hex-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px #0a0c10 inset;
  box-shadow: 0 0 0 1000px #0a0c10 inset;
  transition: background-color 9999s ease-out;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent-authentik);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--accent-authentik-hover);
}

/* Dashboard Tab */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(253, 75, 45, 0.1);
  color: var(--accent-authentik);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Activity & Recent Section */
.dashboard-details {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  flex: 1;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.section-card h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.project-meta-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

/* Kanban Board Styling */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
  margin-top: 16px;
}

.kanban-column {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  max-height: 100%;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.column-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-count {
  font-size: 0.8rem;
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.task-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.task-card-accent {
  height: 10px;
  width: 100%;
}

.task-card-body {
  padding: 12px 16px 16px;
}

.task-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.task-pill-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  padding: 3px 10px;
  border-radius: 9999px;
  line-height: 1.3;
  white-space: nowrap;
}

.task-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.tag-scripting { background: rgba(0, 162, 255, 0.15); color: var(--accent-roblox); }
.tag-modeling { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.tag-ui { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.tag-sound { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.tag-general { background: rgba(156, 163, 175, 0.15); color: var(--text-secondary); }

.task-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.task-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-task-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-task-delete:hover {
  color: var(--accent-red);
}

/* Documents tab split-screen */
.docs-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.docs-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  margin-top: 16px;
  flex: 1;
}

.doc-item {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

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

.doc-item.active {
  background: var(--bg-card);
  border-color: var(--accent-authentik);
}

.doc-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.doc-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.doc-editor {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.doc-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  padding-bottom: 12px;
  margin-bottom: 16px;
  outline: none;
}

.doc-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.doc-editor-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

/* Document Mode Tabs */
.doc-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}

.doc-mode-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.doc-mode-tab.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Markdown Preview Pane */
.doc-preview {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  line-height: 1.7;
}

.doc-preview h1, .doc-preview h2, .doc-preview h3,
.doc-preview h4, .doc-preview h5, .doc-preview h6 {
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  font-weight: 700;
  color: var(--text-primary);
}

.doc-preview h1 { font-size: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.doc-preview h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.doc-preview h3 { font-size: 1.25rem; }
.doc-preview h4 { font-size: 1.1rem; }

.doc-preview p {
  margin-bottom: 1em;
}

.doc-preview ul, .doc-preview ol {
  margin-bottom: 1em;
  padding-left: 2em;
}

.doc-preview li {
  margin-bottom: 0.35em;
}

.doc-preview blockquote {
  border-left: 4px solid var(--accent-authentik);
  margin: 1em 0;
  padding: 8px 16px;
  background: rgba(253, 79, 0, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.doc-preview code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent-roblox);
}

.doc-preview pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.doc-preview pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.doc-preview table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

.doc-preview th, .doc-preview td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.doc-preview th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.doc-preview hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5em 0;
}

.doc-preview a {
  color: var(--accent-authentik);
  text-decoration: none;
}

.doc-preview a:hover {
  text-decoration: underline;
}

.doc-preview img {
  max-width: 100%;
  border-radius: 8px;
}

.doc-preview .task-list-item {
  list-style: none;
  margin-left: -1.5em;
}

.doc-preview input[type="checkbox"] {
  margin-right: 6px;
}

/* Media Gallery Styling */
.media-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-authentik);
  background: rgba(253, 75, 45, 0.02);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
}

.media-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-fast);
  height: fit-content;
}

.media-card:hover {
  transform: translateY(-2px);
}

.media-preview-container {
  aspect-ratio: 16/10;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-icon {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
}

.media-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.media-card:hover .media-actions {
  opacity: 1;
}

.btn-media-action {
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-media-action:hover {
  color: var(--accent-red);
}

/* Chat Tab Layout */
.chat-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 80%;
}

.message-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-sender {
  font-weight: 600;
  font-size: 0.85rem;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.message-text {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.message-code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.3);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  border: 1px solid rgba(255,255,255,0.05);
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.chat-input-form {
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--accent-authentik);
}

/* Modals & Forms */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  animation: fadeIn 0.3s ease;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-main);
  outline: none;
}

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-authentik);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card);
}

/* ========================================================
   NEW TEAM FEATURES STYLING (Code Library & Releases)
   ======================================================== */

/* Snippets Grid */
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
}

.snippet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color var(--transition-fast);
  height: fit-content;
}

.snippet-card:hover {
  border-color: var(--border-hover);
}

.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.snippet-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.snippet-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-client { background: rgba(0, 162, 255, 0.15); color: var(--accent-roblox); }
.tag-server { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.tag-shared { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

.snippet-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.snippet-code-preview {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  max-height: 120px;
}

.snippet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}

.snippet-actions {
  display: flex;
  gap: 8px;
}

/* Releases/Publish Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
  width: 100%;
}

.timeline-item {
  display: flex;
  gap: 20px;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-authentik);
  border: 4px solid var(--bg-primary);
  z-index: 2;
}

.timeline-line {
  flex: 1;
  width: 2px;
  background: var(--border-color);
  margin-top: 4px;
  margin-bottom: -28px;
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.release-version {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-authentik);
}

.release-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.release-notes {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* Idea Board / Mind Map Styles */
.mindmap-workspace {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background-color: #0b0d13;
  cursor: grab;
  min-height: 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.mindmap-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 20px 20px;
}

.mindmap-canvas {
  position: absolute;
  width: 3000px;
  height: 2000px;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

#mindmap-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

#mindmap-nodes {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}

.mindmap-hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 10;
}

.mindmap-workspace.panning {
  cursor: grabbing !important;
}

/* Nodes container and Nodes */
.mindmap-node {
  position: absolute;
  padding: 10px 18px;
  background: rgba(22, 26, 37, 0.85);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  pointer-events: auto;
  min-width: 120px;
  max-width: 250px;
  text-align: center;
  word-wrap: break-word;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%); /* Center node on its coordinates */
}

.mindmap-node:hover {
  border-color: var(--border-hover);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.05);
  background: rgba(26, 31, 44, 0.95);
}

.mindmap-node.selected {
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  background: rgba(30, 32, 50, 0.95);
  font-weight: 600;
}

.mindmap-node.root {
  font-size: 1.05rem;
  padding: 14px 24px;
  font-weight: 700;
  border-width: 2px;
}

/* Connection Paths */
#mindmap-svg path {
  fill: none;
  transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
}

/* Editable Node Input */
.mindmap-node-editor {
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  width: 100%;
  resize: none;
  outline: none;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
