/* GUIDES MODULE - POLISHED THEME
   MVC Architekt Gem - Final Touch
*/

:root {
  --guide-primary: #00f3ff;
  --guide-primary-glow: rgba(0, 243, 255, 0.4);
  --guide-bg-dark: #0b0c15;
  --guide-surface: rgba(255, 255, 255, 0.03);
  --guide-surface-hover: rgba(255, 255, 255, 0.06);
  --guide-border: rgba(255, 255, 255, 0.08);
  --guide-text-main: #f0f0f0;
  --guide-text-muted: rgba(255, 255, 255, 0.6);
  
  /* Status Colors */
  --status-draft-bg: #3e3e3e;
  --status-draft-text: #e0e0e0;
  --status-pub-bg: rgba(46, 194, 126, 0.2);
  --status-pub-text: #4ade80;
  --status-prog-bg: rgba(255, 181, 71, 0.2);
  --status-prog-text: #fbbf24;
  --status-reject-bg: rgba(244, 67, 54, 0.2);
  --status-reject-text: #f87171;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- LAYOUT & UTILS --- */
.page-main, .page-main-narrow {
  padding: 40px 24px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

.page-main-narrow {
  max-width: 900px;
}

.glass-panel {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.back-link {
  color: var(--guide-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  font-weight: 500;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--guide-primary);
}

/* --- HERO SECTION --- */
.guides-hero {
  position: relative;
  padding: 40px 32px;
  background: radial-gradient(circle at top right, rgba(0, 243, 255, 0.1), transparent 60%),
              linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--guide-border);
  border-radius: 20px;
  margin-bottom: 32px;
  overflow: hidden;
}

.guides-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
  letter-spacing: -0.02em;
}

.guides-hero p {
  color: var(--guide-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
}

/* Hero Actions (Buttons) */
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px; /* Mobile spacing */
}

@media(min-width: 768px) {
  .hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .hero-actions {
    margin-top: 0;
  }
}

/* --- BUTTONS --- */
.btn, .btn-primary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  gap: 8px;
}

.btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--guide-primary);
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 243, 255, 0.2);
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 243, 255, 0.4);
  transform: translateY(-2px) scale(1.02);
}

.btn-danger {
  background: rgba(244, 67, 54, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 67, 54, 0.25);
}

/* --- FILTERS & SEARCH --- */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input, .filter-select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--guide-border);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.search-input { flex: 1; min-width: 200px; }
.search-input:focus, .filter-select:focus {
  border-color: var(--guide-primary);
  box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.1);
}

/* --- CARD GRID --- */
.guides-grid, .my-drafts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.guide-card {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  height: 100%;
}

.guide-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 
              0 0 0 1px rgba(0, 243, 255, 0.1); /* Subtle glow border */
}

/* Image Wrapper */
.guide-card .thumb {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: #000;
}

.guide-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  opacity: 0.9;
}

.guide-card:hover .thumb img {
  transform: scale(1.08);
  opacity: 1;
}

.thumb-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.badge-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 2;
}

.guide-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.guide-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #fff;
  font-weight: 700;
}

.guide-card p {
  color: var(--guide-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Updated Card Meta */
.guide-card .meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  gap: 10px;
}

.guide-card .meta .author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.guide-card .meta .author-row:hover {
  color: var(--guide-primary);
}

.guide-card .meta .author-name {
  font-weight: 600;
  color: #fff;
}

.guide-card .meta .date {
  font-size: 0.8rem;
  opacity: 0.7;
}

.card-cta {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: transparent;
  color: var(--guide-primary);
  border: 1px solid rgba(0, 243, 255, 0.3);
  box-shadow: none;
  white-space: nowrap;
}

.card-cta:hover {
  background: rgba(0, 243, 255, 0.1);
  box-shadow: none;
  transform: none;
}

/* --- DETAIL VIEW (SHOW.PHP) --- */
.guide-show {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 20px;
  overflow: hidden;
}

.guide-banner {
  height: 400px;
  position: relative;
}

.guide-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--guide-bg-dark));
  pointer-events: none;
}

.guide-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-content {
  padding: 40px;
  margin-top: -80px; /* Pull content up over banner fade */
  position: relative;
  z-index: 2;
}

.guide-content h1 {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 24px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* NEW METADATA HEADER STYLING */
.meta-header {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--guide-text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--guide-border);
}

/* Author Pill */
.guide-author-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 16px 5px 5px; /* Spacing for avatar left, text right */
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.2s ease;
}

.guide-author-block:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.guide-author-block a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Meta Items (Date, Cat) */
.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item i {
  color: var(--guide-primary);
  opacity: 0.8;
}

/* New Category Badge in Header */
.header-cat-badge {
  color: var(--guide-primary);
  background: rgba(0, 243, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(0, 243, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.05);
}

.content-area {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #e0e0e0;
}

/* Typography inside Content Area */
.content-area h2, .content-area h3 {
  color: var(--guide-primary);
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-weight: 700;
}

.content-area a {
  color: var(--guide-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.content-area img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid var(--guide-border);
}

.content-area code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #ff9e64;
}

.content-area pre {
  background: #000;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--guide-border);
}

/* --- FORMS & EDITOR --- */
.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--guide-text-muted);
  font-size: 0.9rem;
}

.form-row input[type="text"], 
.form-row input[type="file"],
.form-row textarea, 
.form-row select {
  width: 100%;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--guide-border);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  transition: all 0.2s;
}

.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--guide-primary);
  background: rgba(0,0,0,0.4);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.1);
}

/* Editor Toolbar */
.toolbar {
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--guide-border);
  border-bottom: none;
  display: flex;
  gap: 6px;
}

.toolbar button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.toolbar button:hover, .toolbar button.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.editor-textarea {
  border-radius: 0 0 10px 10px !important;
  min-height: 400px;
}

/* Editor Layout (Create/Edit) */
.editor-shell {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.editor-main {
  flex: 1;
}

.editor-aside {
  width: 320px;
}

.preview-box {
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid var(--guide-border);
  color: var(--guide-text-main);
}

.current-image {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}

.current-image img {
  max-width: 100%;
  width: 240px;
  border-radius: 8px;
  border: 1px solid var(--guide-border);
}

/* --- STATUS BADGES --- */
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-draft { background: var(--status-draft-bg); color: var(--status-draft-text); }
.status-in_progress { background: var(--status-prog-bg); color: var(--status-prog-text); }
.status-published { background: var(--status-pub-bg); color: var(--status-pub-text); border: 1px solid rgba(74, 222, 128, 0.2); }
.status-rejected { background: var(--status-reject-bg); color: var(--status-reject-text); }

/* --- REJECTION BOX --- */
.rejection-box {
  background: rgba(244, 67, 54, 0.1);
  border-left: 4px solid #f87171;
  padding: 16px;
  margin: 20px 0;
  border-radius: 0 12px 12px 0;
  color: #fff;
  animation: fadeIn 0.3s ease-out;
}

.rejection-box strong {
  color: #f87171;
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.rejection-box p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.9);
}

.rejection-box .muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* --- ADMIN REVIEW LIST --- */
.admin-guides-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.admin-guide-item {
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.admin-guide-item h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #fff;
}

.admin-guide-item .meta {
  color: var(--guide-text-muted);
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.admin-guide-item .excerpt {
  color: rgba(224, 224, 224, 0.8);
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-action-form {
  display: inline-block;
}

/* --- UTILS --- */
.flash-wrap { margin-bottom: 24px; }
.flash-message {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(46, 194, 126, 0.15);
  border-color: rgba(46, 194, 126, 0.3);
  color: #86efac;
}

.flash-error {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.3);
  color: #fca5a5;
}

.flash-close {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1.2rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--guide-text-muted);
  background: var(--guide-surface);
  border-radius: 12px;
  border: 1px dashed var(--guide-border);
}

/* Image loading overlay */
.image-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .editor-shell { flex-direction: column; }
  .editor-aside { width: 100%; }
}

@media (max-width: 768px) {
  .guides-hero h1 { font-size: 1.8rem; }
  .guide-content { padding: 24px; margin-top: -40px; }
  .guide-banner { height: 250px; }
  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; }
}

/* --- COMMENTS SECTION --- */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--guide-border);
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment {
  background: var(--guide-surface);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--guide-border);
  transition: border-color 0.2s;
}

.comment:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.comment-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--guide-text-muted);
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--guide-border);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-author {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}

.comment-date {
  margin-left: auto;
  color: var(--guide-text-muted);
  font-size: 0.85rem;
}

.comment-content {
  color: var(--guide-text-main);
  line-height: 1.6;
  font-size: 0.95rem;
  padding-left: 62px; /* Avatar width + gap */
}

.comment-actions {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  padding-left: 62px;
}

.comment-action {
  background: none;
  border: none;
  color: var(--guide-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.comment-action:hover {
  color: var(--guide-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.comment-action.delete {
  color: var(--status-reject-text);
}

.comment-action.delete:hover {
  background: rgba(244, 67, 54, 0.1);
  text-decoration: none;
  padding: 2px 8px;
  margin: -2px -8px;
  border-radius: 4px;
}

.comment-replies {
  margin-left: 62px;
  margin-top: 20px;
  padding-left: 20px;
  border-left: 2px solid var(--guide-border);
}

/* small count next to comments title */
.comment-count {
  color: var(--guide-text-muted);
  font-weight: 600;
  margin-left: 8px;
  font-size: 0.95rem;
}

/* admin badge in comment header */
.admin-badge {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  color: var(--guide-text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.03);
}

/* Comment Form */
.comment-form {
  margin-bottom: 40px;
  background: var(--guide-surface);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--guide-border);
}

.comment-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--guide-border);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  margin-bottom: 16px;
  resize: vertical;
  transition: all 0.2s;
}

.comment-form textarea:focus {
  border-color: var(--guide-primary);
  background: rgba(0, 0, 0, 0.4);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.1);
}

.comment-submit {
  background: var(--guide-primary);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.comment-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--guide-primary-glow);
}

.reply-indicator {
  color: var(--guide-primary);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: inline-block;
  align-items: center;
  gap: 8px;
  background: rgba(0, 243, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
}

/* hidden helper used to hide reply indicator until a reply is started */
.reply-indicator.hidden { display: none !important; }

/* small utility for the cancel reply button */
.cancel-reply {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  margin-left: 0.5rem;
  font-size: 0.95rem;
}

/* guest prompt for commenting */
.comment-login-cta { color: rgba(224,224,224,0.6); margin-bottom: 1.5rem; }
.comment-login-cta a { color: var(--guide-primary); text-decoration: none; }

/* fallback avatar small tweak */
.avatar-fallback { font-size: 0.9rem; display:flex; align-items:center; justify-content:center; }

/* ensure forms in comment-actions flow inline */
.comment-actions form { display: inline-block; }

/* Mobile Tweaks */
@media (max-width: 600px) {
  .comment-content, .comment-actions { padding-left: 0; }
  .comment-replies { margin-left: 20px; }
  .comment-form { padding: 16px; }
}

/* action row for bottom of guide */
.action-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: flex-start;
  align-items: center;
}

/* --- MODAL SYSTEM --- */
#modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none; /* Klicks gehen durch, wenn unsichtbar */
}

#modal.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-window {
  position: relative;
  background: #13141f; /* Fallback opaque color */
  background: var(--guide-surface);
  border: 1px solid var(--guide-border);
  border-radius: 16px;
  width: min(720px, 94%);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 
              0 0 0 1px rgba(255, 255, 255, 0.05);
  
  /* Animation Start State */
  transform: scale(0.94) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#modal.visible .modal-window {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--guide-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-content {
  padding: 24px;
  color: var(--guide-text-main);
  font-size: 1rem;
  line-height: 1.6;
}

.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--guide-border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Template Helper (hidden by default) */
.modal-template { display: none !important; }

/* Responsive adjustments */
@media (max-width: 600px) {
  .modal-actions { flex-direction: column; }
  .modal-actions button, .modal-actions a { width: 100%; }
}

/* Author Avatar Mini (for meta headers) */
.author-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--guide-text-muted);
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--guide-border);
}

.author-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* author-avatar-small utility for comment section reuse */
.author-avatar-small {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--guide-text-muted);
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--guide-border);
}

.author-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}