:root {
  --primary-color: #8b5cf6;
  /* Violet 500 */
  --primary-hover: #7c3aed;
  /* Violet 600 */
  --primary-light: #ddd6fe;
  /* Violet 200 */
  --background-color: #f8faff;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  /* Slate 800 */
  --text-secondary: #64748b;
  /* Slate 500 */
  --border-color: #e2e8f0;
  /* Slate 200 */
  --danger-color: #ef4444;
  --success-color: #22c55e;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

.hero-section {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  padding: 4rem 1rem;
  text-align: center;
  border-radius: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  color: white;
  box-shadow: var(--shadow-lg);
}

.hero-section h1 {
  color: white;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

.container {
  max-width: 98%;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Header */
header {
  background-color: var(--surface-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 70px;
  display: flex;
  align-items: center;
}

/* ... (omitting lines for brevity, will target specific blocks if possible, but replace_file_content needs contiguous) */
/* Actually, I will make two separate edits to avoid replacing the whole file content in one big chunk if they are far apart, 
   but here the container is line 73 and post-layout is line 495. They are far apart. 
   I should use multi_replace. Or standard replace for each. 
   
   Let's use `replace_file_content` for `.container` first.
*/

/* Header */
header {
  background-color: var(--surface-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 70px;
  display: flex;
  align-items: center;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links a:not(.btn) {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:not(.btn):hover {
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

/* Layout Grid */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

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

/* Cards */
.card {
  background: var(--surface-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(139, 92, 246, 0.2);
}

/* Post Card Customizations */
.post-preview h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-preview h2 a {
  color: var(--text-primary);
}

.post-preview h2 a:hover {
  color: var(--primary-color);
}

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

.tag-badge {
  background: #f3f4f6;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #4b5563;
}

/* Sidebar Widgets */
.sidebar .card {
  border-top: 4px solid var(--primary-color);
}

.profile-card {
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-name {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary-color);
  padding-left: 0.75rem;
  line-height: 1.2;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.4);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Typography & Content */
h1 {
  font-size: 2rem;
  font-weight: 800;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.post-content {
  font-size: 1.1rem;
  color: #334155;
  line-height: 1.8;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

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

.post-content img {
  max-width: 100%;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* Footer */
footer {
  margin-top: auto;
  background-color: white;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
}

/* Admin Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

/* Comment System */
.comment-section {
  margin-top: 3rem;
}

.comment {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: #f8fafc;
  /* Light background for root comments */
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.comment:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

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

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-floor {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.comment-author {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-date {
  font-size: 0.85rem;
  color: #94a3b8;
}

.comment-body {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.comment-actions .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 9999px;
}

/* Nested Replies */
.comment-replies {
  margin-top: 1rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary-light);
  /* More visible border */
}

.comment-replies .comment {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
  /* Darker background for contrast */
  border-radius: 0.5rem;
  position: relative;
  /* For potential styling */
}

.comment-replies .comment:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: #f8fafc;
}

/* Alert Styles */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

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

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Post Detail Layout */
.post-layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 1rem;
  align-items: start;
  margin-top: 2rem;
}

.post-main {
  min-width: 0;
  /* Prevent grid blowout */
}

.post-sidebar {
  position: sticky;
  top: 90px;
  /* Header height (70px) + 20px gap */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  /* Custom Scrollbar for sidebar */
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) transparent;
}

.post-sidebar::-webkit-scrollbar {
  width: 6px;
}

.post-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.post-sidebar .comment-section {
  margin-top: 0;
  /* Reset margin since it's in sidebar now */
}

@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    position: static;
    /* Disable sticky on mobile */
    max-height: none;
    overflow-y: visible;
  }
}

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

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.pagination-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.05);
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0.5rem;
  font-weight: 500;
}