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

:root {
  /* Dark theme colors */
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f1729;
  --bg-hover: #1f2937;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --accent: #4A90D9;
  --accent-hover: #3b7ac7;
  --border: #2d3748;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-hover: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #d1d5db;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.2s;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin: 0.25rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-nav svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding-bottom: 100px; /* Space for persistent player */
}

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.user-menu:hover {
  background: var(--bg-hover);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--error);
}

.btn-success {
  background: var(--success);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Dashboard widgets */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.widget-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.widget-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Blog */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  transition: transform 0.2s;
}

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

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.post-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.post-preview {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 0.375rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.2s;
}

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

.post-content {
  line-height: 1.8;
  font-size: 1.05rem;
}

.post-content h1, .post-content h2, .post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }

.post-content p {
  margin-bottom: 1rem;
}

.post-content code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content ul, .post-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

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

/* Comments */
.comments {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.comment {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.comment-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.comment-text {
  color: var(--text-primary);
  line-height: 1.6;
}

/* Files */
.file-list {
  display: grid;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: background 0.2s;
  cursor: pointer;
}

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

.file-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.file-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  padding: 3rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 2rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(74, 144, 217, 0.05);
}

/* Chat */
.chat-container {
  display: flex;
  height: calc(100vh - 180px);
  gap: 1rem;
}

.chat-sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow-y: auto;
}

.chat-room {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}

.chat-room:hover,
.chat-room.active {
  background: var(--bg-hover);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.message-text {
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-input-container {
  border-top: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

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

/* Media player */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.media-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.media-thumbnail {
  width: 100%;
  height: 150px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-info {
  padding: 1rem;
}

.media-title {
  font-weight: 500;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Persistent audio player */
.persistent-player {
  position: fixed;
  bottom: 0;
  left: 250px;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 50;
}

.persistent-player.active {
  display: flex;
}

.player-info {
  flex: 1;
}

.player-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.player-artist {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.player-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.player-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

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

.player-btn.play {
  background: var(--accent);
  color: white;
}

.player-progress {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.player-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.1s;
}

.player-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: center;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.pagination a,
.pagination span {
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
}

.pagination a:hover {
  background: var(--bg-hover);
}

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

/* Landing page */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.landing-posts {
  padding: 4rem 3rem;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

.landing-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Auth pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

.auth-form {
  margin-top: 1.5rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .persistent-player {
    left: 0;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .chat-container {
    flex-direction: column;
  }

  .chat-sidebar {
    width: 100%;
    max-height: 200px;
  }
}

/* Utility classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.85rem; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }
