@import './variables.css';

/* CARDS */
.card-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.card {
  background: var(--card-bg);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.35);
  flex: 1;
  min-width: 290px;
  border: 1px solid var(--card-border);
}

.card-accent {
  background: radial-gradient(circle at top left, #eef2ff 0, var(--card-bg) 40%);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.card-subtitle {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

/* FORMS */
.form label {
  display: block;
  font-size: 0.88rem;
  color: #374151;
  margin-bottom: 0.4rem;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  font-size: 0.95rem;
  background: white;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

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

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* BUTTONS */
.btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand-primary-start), var(--brand-primary-end));
  color: white;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.secondary-btn {
  background: var(--brand-secondary);
  color: var(--text-light);
  border: 1px solid var(--text-muted);
}

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

.tertiary-btn {
  background: var(--card-bg);
  color: #111827;
  border: 1px solid var(--input-border);
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
}

.tertiary-btn:hover {
  background: var(--card-border);
}

/* MESSAGES & ALERTS */
.message {
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.info-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
  color: #1e3a8a;
}

.info-box h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.9rem;
}

.info-box ul {
  padding-left: 1.1rem;
  margin: 0;
}

.badge {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: var(--warning);
  color: white;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.6);
}

.filter-label {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}

/* POSTS */
.posts-header-right {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#posts-list {
  margin-top: 0.5rem;
}

.empty-state {
  font-size: 0.9rem;
  color: var(--text-subtle);
  padding: 0.6rem 0;
}

#posts-container {
  margin-top: 0.5rem;
}

.post-card {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s;
}

.post-card:hover {
  background: var(--card-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.post-channel-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  background: #dbeafe;
  color: #1d4ed8;
}

.post-content {
  font-size: 0.95rem;
  color: #111827;
  white-space: pre-wrap;
  margin-bottom: 0.4rem;
}

.post-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.post-action {
  cursor: pointer;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.post-action:hover {
  color: #111827;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.6);
  max-width: 700px;
  width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--card-border);
}

.modal-large {
  max-width: 800px;
}

.modal-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
}

.close-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-subtle);
}

.close-btn:hover {
  color: #111827;
}

.modal-posts {
  padding: 0.9rem 1.1rem;
  overflow-y: auto;
  flex: 1;
}

.modal-post-card {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-post-card:hover {
  background: var(--card-border);
}

.modal-post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.modal-post-content {
  font-size: 0.9rem;
  color: #111827;
  white-space: pre-wrap;
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Detail post */
.detail-post-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.detail-post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-post-content {
  font-size: 1.05rem;
  color: #111827;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Reactions */
.reactions-section h3 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.reactions-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.reaction-btn {
  background: #f3f4f6;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.15s;
}

.reaction-btn:hover {
  background: var(--card-border);
}

.reaction-count {
  font-weight: 500;
  color: #374151;
}

/* Replies */
.replies-section h3 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.reply-form {
  margin-bottom: 1rem;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reply-card {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  padding: 0.75rem;
}

.reply-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.reply-content {
  font-size: 0.9rem;
  color: #111827;
  white-space: pre-wrap;
}
