/* ============================================================================================
   INVESTOR COMPASS - COMMUNITY STYLESHEET
   Clean B2B SaaS Aesthetics matching the landing page and builder light theme
   ============================================================================================ */

.community-hero {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 4rem 0 3rem 0;
  text-align: center;
  margin-top: 76px; /* navbar offset */
}

.community-hero .hero-title {
  font-size: 2.5rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.community-hero .hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-body);
  max-width: 700px;
  margin: 0 auto;
}

.community-main {
  padding: 3rem 0;
  background-color: var(--bg-page);
  min-height: calc(100vh - 350px);
}

/* Tabs System */
.community-tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 2.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--primary);
  background-color: var(--bg-subtle);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Gallery Headers */
.gallery-header {
  margin-bottom: 2rem;
}

.gallery-header h2 {
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.gallery-header p {
  color: var(--text-body);
  font-size: 0.95rem;
}

/* Cards Grids */
.layouts-grid, .themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Card Styling */
.community-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.community-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-preview {
  height: 180px;
  background-color: #0b0d12;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  color: #3b82f6;
  font-size: 0.85rem;
}

.card-preview-canvas-placeholder {
  width: 200px;
  height: 150px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-title-row h3 {
  font-size: 1.15rem;
  color: var(--text-main);
}

.user-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}

/* Roles colors */
.role-free {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
}

.role-pro {
  background-color: #eff6ff;
  color: #2563eb;
}

.role-ultimate {
  background-color: #fef3c7;
  color: #b45309;
}

.role-admin {
  background-color: #fee2e2;
  color: #dc2626;
}

.card-desc {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  margin-top: auto;
}

.card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-like {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-like:hover {
  color: #ef4444;
}

.btn-like.liked {
  color: #ef4444;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  z-index: 2000;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1.2rem;
  color: var(--text-main);
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.auth-divider span {
  padding: 0 10px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.google-icon {
  width: 18px;
  height: 18px;
}

.auth-footer-text {
  text-align: center;
  font-size: 0.88rem;
  margin-top: 1.5rem;
  color: var(--text-body);
}

.auth-footer-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

/* Forum Discussion Layouts */
.forum-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

.forum-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.forum-categories {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.forum-categories li {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: var(--transition);
}

.forum-categories li:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

.forum-categories li.active {
  background-color: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}

.forum-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forum-thread-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.forum-thread-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.thread-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.thread-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.thread-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.thread-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Database schema styling */
.schema-viewer-container {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  background-color: #0f172a;
}

.schema-code-header {
  background-color: #1e293b;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 600;
}

.schema-viewer-container pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.schema-viewer-container code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8; /* Soft blue */
  line-height: 1.6;
}

/* Inline Lucide Icon Alignments */
.icon-inline {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

[data-lucide] {
  stroke-width: 2px;
}
