/**
 * Title    : Website Styles
 * Project  : Creative Coding
 * File     : apps/node-collab-server/public/css/style.css
 * Version  : 1.0.0
 * Published: https://github.com/cnichte/creative-coding
 *
 * Minimal dark theme CSS for Quiet Frames website.
 *
 * Licence: CC BY-NC-SA 4.0
 * @author Carsten Nichte - 2024, 2026
 */

:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --text: #e0e0e0;
  --text-muted: #888888;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border: #2a2a2a;
  --code-bg: #1a1a1a;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
}

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

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Main Content */
.main {
  flex: 1;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page {
  padding-top: 4rem;
}

/* Content Styles */
.content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content p {
  margin-bottom: 1.25rem;
}

.content a {
  color: var(--accent);
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content ul, .content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.content pre {
  background: var(--code-bg);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.25 !important;
  display: block;
}

/* Fix für ASCII-Diagramme in Code-Blöcken */
.content pre code * {
  line-height: inherit !important;
  margin: 0;
  padding: 0;
}

.content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.content th, .content td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.content th {
  font-weight: 600;
  background: var(--bg-secondary);
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Docs Layout */
.doc-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.doc-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.doc-nav h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.doc-nav ul {
  list-style: none;
  padding: 0;
}

.doc-nav li {
  margin-bottom: 0.5rem;
}

.doc-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.doc-nav a:hover,
.doc-nav a.active {
  color: var(--accent);
}

.doc-content {
  max-width: 800px;
}

/* Docs Index Grid */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.docs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

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

.docs-card h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  border: none;
  padding: 0;
  color: var(--text);
}

.docs-card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* News */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s;
}

.news-item:hover {
  border-color: var(--accent);
}

.news-item time {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.news-item h2 {
  font-size: 1.25rem;
  margin: 0.5rem 0;
  color: var(--text);
  border: none;
  padding: 0;
}

.news-item p {
  color: var(--text-muted);
  margin: 0;
}

.news-header {
  margin-bottom: 2rem;
}

.news-header time {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.news-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent);
}

/* Features Grid */
.features {
  padding: 4rem 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature {
  text-align: center;
  padding: 1.5rem;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.feature-icon svg {
  width: 48px;
  height: 48px;
}

.feature h3 {
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }
  
  .container {
    padding: 2rem 1rem;
  }
  
  .doc-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .doc-sidebar {
    position: static;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* ========================================
   GALLERY & LIFESTREAM STYLES
   ======================================== */

/* Gallery Index Page */
.gallery-index {
  max-width: 1200px;
}

.gallery-index .page-header {
  text-align: center;
  margin-bottom: 4rem;
}

.gallery-index h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.galleries-section,
.exhibitions-section {
  margin-bottom: 4rem;
}

.galleries-section h2,
.exhibitions-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-intro {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.gallery-card-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.gallery-card-content {
  padding: 1.25rem;
}

.gallery-card h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.gallery-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.gallery-card .item-count {
  font-size: 0.8rem;
  color: var(--accent);
}

/* Exhibitions List */
.exhibitions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exhibition-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
}

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

.exhibition-card.active {
  border-color: var(--success);
}

.exhibition-content h3 {
  color: var(--text);
  margin-bottom: 0.25rem;
}

.exhibition-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.exhibition-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-badge {
  background: var(--success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.lifestream-link {
  margin-top: 1.5rem;
}

/* Gallery Page */
.gallery-page {
  max-width: 1200px;
}

.breadcrumb {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.gallery-page .page-header {
  margin-bottom: 3rem;
}

.gallery-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.gallery-page .item-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Gallery Items Grid */
.gallery-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gallery-item-image {
  aspect-ratio: 4/3;
  background: var(--bg-secondary);
}

.gallery-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-info {
  padding: 1rem;
}

.gallery-item-info h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.gallery-item-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.gallery-item-info .date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gallery-item-info .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.gallery-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Lifestream Page */
.lifestream-page {
  max-width: 1200px;
}

.lifestream-page .page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.lifestream-page h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.snapshot-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Exhibition Filter */
.exhibition-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Snapshots Grid */
.snapshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.snapshot-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.snapshot-item:hover {
  transform: scale(1.02);
}

.snapshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snapshot-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  font-size: 0.75rem;
}

.snapshot-time {
  display: block;
}

.snapshot-exhibition {
  display: block;
  color: var(--accent);
  margin-top: 0.25rem;
}

/* New snapshot animation */
.snapshot-new {
  animation: pulse 1s ease-out;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lifestream-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-info {
  margin-top: 1rem;
  text-align: center;
  color: white;
}

.lightbox-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.lightbox-description {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.lightbox-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Scroll Sentinel */
.scroll-sentinel {
  height: 1px;
}

/* Gallery Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .snapshots-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .exhibition-filter {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
  }
  
  .lightbox-content {
    max-width: 95vw;
  }
}
