/* Reddit Organic Styles */

/* Status Banner */
.status-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.status-connected {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border: 1px solid #86efac;
}

.status-disconnected {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.status-error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Tabs */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

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

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

/* Filter Select */
.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

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

/* Post Card */
.post-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-card.draft {
  border-left: 4px solid #94a3b8;
}

.post-card.posted {
  border-left: 4px solid #22c55e;
}

.post-card.removed {
  border-left: 4px solid #ef4444;
  opacity: 0.7;
}

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

.post-type {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.type-post {
  background: #ede9fe;
  color: #7c3aed;
}

.type-comment {
  background: #e0f2fe;
  color: #0284c7;
}

.post-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.status-draft {
  background: #f1f5f9;
  color: #64748b;
}

.status-posted {
  background: #dcfce7;
  color: #166534;
}

.status-removed {
  background: #fee2e2;
  color: #991b1b;
}

.status-deleted {
  background: #f1f5f9;
  color: #64748b;
}

.post-subreddit {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
}

.post-content {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.post-project {
  font-size: 0.8rem;
  color: var(--primary);
  background: #f5f3ff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.post-engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
}

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

.post-synced {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

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

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

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: var(--background-light);
}

.btn-small.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-small.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-small.btn-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-small.btn-danger:hover {
  background: #fee2e2;
}

/* Modal Enhancements */
.modal-large {
  max-width: 800px;
  width: 90vw;
}

/* Input with prefix */
.input-with-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix {
  padding: 0.75rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.input-with-prefix input {
  border-radius: 0 8px 8px 0;
  flex: 1;
}

/* Search Row */
.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

/* Search Results */
.search-results {
  margin: 1rem 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.search-results h4 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.search-result-item {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: #f9fafb;
  border-color: var(--primary);
}

.result-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

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

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 1rem;
}

/* Selected Post Info */
.selected-post-info {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.selected-post-info h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: #166534;
}

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

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

/* Character Count */
.char-count {
  text-align: right;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* View Post Styles */
.view-post-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.view-subreddit {
  font-size: 1.25rem;
  color: var(--primary);
  margin: 0 0 0.5rem 0;
}

.view-title {
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
}

.view-content {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.view-project {
  margin-bottom: 1rem;
}

.view-engagement {
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 12px;
}

.view-engagement h4 {
  margin: 0 0 1rem 0;
  color: var(--primary-dark);
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.engagement-stat {
  text-align: center;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
}

.engagement-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.engagement-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.view-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.view-meta p {
  margin: 0.5rem 0;
}

.view-meta a {
  color: var(--primary);
  word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
  .post-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-row {
    flex-direction: column;
  }

  .tabs-container {
    justify-content: center;
  }

  .engagement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
