/* =========================================
   ESTILOS PREMIUM: CARTICLE CARD
========================================= */

/* Contenedor Grid Responsivo */
.carticle-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

/* Base de la Tarjeta */
.carticle-card {
  background: var(--white, #ffffff);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.carticle-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Efectos Dinámicos al Hover */
.carticle-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--primary, #1e3a8a);
}

/* Área de Imagen */
.carticle-img-wrap {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.carticle-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.carticle-card:hover .carticle-img-wrap img {
  transform: scale(1.08); /* Zoom in progresivo */
}

/* Contenido Interno */
.carticle-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.carticle-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  margin-bottom: 0.75rem;
  font-family: 'Inter', sans-serif;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carticle-excerpt {
  color: var(--text-light, #64748b);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botón Interno "Ver más" */
.carticle-btn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary, #1e3a8a);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.3s ease;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.carticle-card:hover .carticle-btn-more {
  gap: 0.8rem;
}

/* =========================================
   Ghost Card (Añadir Nueva)
========================================= */
.carticle-ghost {
  border: 2px dashed #cbd5e1;
  background: rgba(248, 250, 252, 0.4);
  box-shadow: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  min-height: 380px;
}

.carticle-ghost:hover {
  background: rgba(30, 58, 138, 0.03);
  border-color: var(--primary, #1e3a8a);
  transform: translateY(-5px);
}

.carticle-ghost-icon {
  font-size: 3rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.carticle-ghost:hover .carticle-ghost-icon {
  color: var(--primary, #1e3a8a);
  transform: scale(1.1);
}

.carticle-ghost-text {
  font-weight: 600;
  color: #64748b;
  font-size: 1.1rem;
}

/* =========================================
   Panel de Creación Premium (MODAL FULLSCREEN)
========================================= */
.carticle-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.carticle-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.carticle-modal-content {
  background: white;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 900px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.carticle-modal-overlay.active .carticle-modal-content {
  transform: scale(1) translateY(0);
}

.carticle-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.carticle-modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--primary, #1e3a8a);
  font-weight: 800;
}

.carticle-modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #64748b;
  transition: color 0.2s;
}

.carticle-modal-close:hover {
  color: #ef4444;
}

.carticle-modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.carticle-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* =========================================
   FILE UPLOAD ZONE (Drag & Drop)
========================================= */
.blog-file-upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8fafc;
  margin-top: 0.5rem;
  text-align: center;
}

.blog-file-upload-area:hover,
.blog-file-upload-area.dragover {
  border-color: var(--primary, #1e3a8a);
  background: rgba(30, 58, 138, 0.04);
}

.blog-file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  padding: 1rem 0;
}

.blog-file-placeholder i {
  font-size: 2.5rem;
  color: #cbd5e1;
  transition: color 0.3s;
}

.blog-file-upload-area:hover .blog-file-placeholder i {
  color: var(--primary, #1e3a8a);
}

.blog-file-placeholder span {
  font-size: 0.9rem;
  font-weight: 500;
}

/* =========================================
   NATIVE WYSIWYG EDITOR — PROFESSIONAL TOOLBAR
========================================= */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.editor-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 2px 0;
}

.editor-toolbar-row + .editor-toolbar-row {
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
  margin-top: 3px;
}

.editor-separator {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
  margin: 0 5px;
  flex-shrink: 0;
}

.editor-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #475569;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  position: relative;
}

.editor-btn:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(99,102,241,0.15);
}

.editor-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.editor-btn.active {
  background: #4338ca;
  color: white;
  border-color: #4338ca;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.editor-btn i {
  pointer-events: none;
  font-size: 0.8rem;
}

.editor-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1e293b;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s ease;
  z-index: 999;
}

.editor-btn:hover[title]::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Selects (Format, Font, Size) */
.editor-select {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  height: 30px;
  outline: none;
  transition: all 0.15s ease;
  max-width: 140px;
}

.editor-select:hover {
  border-color: #818cf8;
}

.editor-select:focus {
  border-color: #4338ca;
  box-shadow: 0 0 0 2px rgba(67,56,202,0.15);
}

.editor-select-font {
  max-width: 150px;
}

.editor-select-size {
  max-width: 70px;
}

.editor-select-format {
  max-width: 145px;
}

/* Color Picker Wrappers */
.editor-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.editor-color-wrap input[type="color"] {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.editor-color-indicator {
  width: 14px;
  height: 3px;
  border-radius: 1px;
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Editor Content Area */
.editor-content {
  min-height: 500px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 10px 10px;
  padding: 1.5rem 2rem;
  font-size: 1rem;
  line-height: 1.8;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-grow: 1;
}

.editor-content:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Rich content styles inside the editor */
.editor-content h1 { font-size: 2rem; font-weight: 900; color: #0f172a; margin: 1.5rem 0 0.75rem; line-height: 1.2; }
.editor-content h2 { font-size: 1.6rem; font-weight: 800; color: var(--primary, #1e3a8a); margin: 1.5rem 0 0.5rem; line-height: 1.3; }
.editor-content h3 { font-size: 1.3rem; font-weight: 700; color: #334155; margin: 1.25rem 0 0.5rem; }
.editor-content h4 { font-size: 1.1rem; font-weight: 600; color: #475569; margin: 1rem 0 0.5rem; }
.editor-content p { margin-bottom: 1rem; }
.editor-content blockquote {
  border-left: 4px solid var(--primary, #4338ca);
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  background: #f0f0ff;
  border-radius: 0 8px 8px 0;
  color: #475569;
  font-style: italic;
}
.editor-content ul { margin-left: 1.5rem; margin-bottom: 1rem; list-style-type: disc; padding-left: 1rem; }
.editor-content ol { margin-left: 1.5rem; margin-bottom: 1rem; list-style-type: decimal; padding-left: 1rem; }
.editor-content li { margin-bottom: 0.25rem; }
.editor-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.editor-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.editor-content table td,
.editor-content table th {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  min-width: 60px;
  vertical-align: top;
}
.editor-content table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
}
.editor-content table tr:hover td {
  background: #f8fafc;
}
.editor-content hr {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 1.5rem 0;
}
.editor-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.editor-content a {
  color: #4338ca;
  text-decoration: underline;
}

/* Word count bar */
.editor-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 10px 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* =========================================
   DELETE BLOG BUTTON (on cards)
========================================= */
.carticle-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  backdrop-filter: blur(4px);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.carticle-card:hover .carticle-delete-btn {
  opacity: 1;
  transform: scale(1);
}

.carticle-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* =========================================
   EDIT BLOG BUTTON (on cards)
========================================= */
.carticle-edit-btn {
  position: absolute;
  top: 10px;
  right: 50px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  backdrop-filter: blur(4px);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.carticle-card:hover .carticle-edit-btn {
  opacity: 1;
  transform: scale(1);
}

.carticle-edit-btn:hover {
  background: #4338ca;
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* =========================================
   PREMIUM CONFIRMATION DIALOG
========================================= */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.confirm-dialog-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.confirm-dialog {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.confirm-dialog-overlay.active .confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fef2f2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem;
  border: 2px solid #fecaca;
}

.confirm-dialog h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.confirm-dialog p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.confirm-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-dialog-actions button {
  padding: 0.7rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-confirm-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0 !important;
}

.btn-confirm-cancel:hover {
  background: #e2e8f0;
}

.btn-confirm-delete {
  background: #ef4444;
  color: white;
}

.btn-confirm-delete:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Delete button on blog-post reading page */
.blogPost-admin-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.btn-delete-post {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-edit-post {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* Card fade-out animation on delete */
.carticle-card.deleting {
  animation: cardFadeOut 0.4s ease forwards;
}

@keyframes cardFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

/* Contenedor extra inputs de Modal */
.form-group.highlighted {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

/* =========================================
   BLOG-POST LAYOUT (Página de Lectura)
========================================= */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  margin-top: 120px;
  margin-bottom: 5rem;
  min-height: 50vh;
  align-items: start;
}

@media (max-width: 992px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .blogSidebar {
    position: static;
    margin-top: 2rem;
  }
}

/* =========================================
   PUBLICACION DEL BLOG (blog-post.html)
========================================= */
.blogPost-hero {
  width: 100%;
  height: 420px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
}

.blogPost-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blogPost-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  font-weight: 500;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.blogPost-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.blogPost-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 1rem;
  word-break: break-word;
}

@media (max-width: 768px) {
  .blogPost-title {
    font-size: 1.8rem;
  }
  .blogPost-hero {
    height: 240px;
    border-radius: 12px;
  }
}

.blogPost-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #334155;
  word-break: break-word;
}

.blogPost-content h2, .blogPost-content h3 {
  color: #0f172a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.blogPost-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.blogPost-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.blogPost-content p {
  margin-bottom: 1.25rem;
}

.blogPost-content img {
  border-radius: 12px;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin: 2rem 0;
  display: block;
}

.blogPost-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style-type: disc;
  padding-left: 1.5rem;
}

.blogPost-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style-type: decimal;
  padding-left: 1.5rem;
}

.blogPost-content li {
  margin-bottom: 0.5rem;
}

.blogPost-content blockquote {
  border-left: 4px solid var(--primary, #1e3a8a);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  color: #475569;
  font-style: italic;
}

.blogPost-content a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: all 0.2s;
}

.blogPost-content a:hover {
  color: #1d4ed8;
  text-decoration-thickness: 2px;
}

/* =========================================
   PAYWALL — Contenido para miembros
========================================= */

/* Preview: contenido recortado con fade hacia abajo */
.blogPost-content-preview {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #334155;
  word-break: break-word;
  position: relative;
  max-height: 280px;
  overflow: hidden;
}

.blogPost-content-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent 0%, #ffffff 90%);
  pointer-events: none;
}

/* Tarjeta principal del paywall */
.blog-paywall {
  margin-top: 0;
  padding: 0 0 2rem;
}

.blog-paywall-inner {
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
  border: 1.5px solid #c7d2fe;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
}

.blog-paywall-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary, #0077b6), var(--accent, #00b4d8), #6366f1);
  border-radius: 20px 20px 0 0;
}

.blog-paywall-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: grayscale(0.1);
}

.blog-paywall-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-paywall-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

.blog-paywall-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.blog-paywall-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-paywall-btn--primary {
  background: linear-gradient(135deg, var(--primary, #0077b6), var(--accent, #00b4d8));
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 119, 182, 0.35);
}

.blog-paywall-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.45);
}

.blog-paywall-btn--secondary {
  background: #ffffff;
  color: var(--primary, #0077b6) !important;
  border: 1.5px solid var(--primary, #0077b6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.blog-paywall-btn--secondary:hover {
  background: #f0f9ff;
  transform: translateY(-2px);
}

.blog-paywall-note {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
}

@media (max-width: 500px) {
  .blog-paywall-actions { flex-direction: column; align-items: center; }
  .blog-paywall-btn { width: 100%; justify-content: center; }
  .blog-paywall-title { font-size: 1.2rem; }
}


.blogSidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.sidebar-widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.sidebar-search {
  display: flex;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.sidebar-search input {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 0; /* Evita desbordamiento */
  outline: none;
  font-size: 0.9rem;
}

.sidebar-search button {
  background: var(--primary, #1e3a8a);
  color: white;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.sidebar-search button:hover {
  background: var(--primary-dark);
}

.recent-article {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  text-decoration: none;
  color: #334155;
  transition: color 0.2s;
  padding: 0.5rem;
  border-radius: 8px;
}

.recent-article:last-child {
  margin-bottom: 0;
}

.recent-article:hover {
  color: var(--primary);
  background: #f8fafc;
}

.recent-icon {
  background: #e0f2fe;
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recent-title {
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
  word-break: break-word;
}

/* =========================================
   PDF ATTACHMENT LINK (Blog Post Footer)
========================================= */
.blogPost-pdf-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
}

.blogPost-pdf-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 14px;
  text-decoration: none;
  color: white;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.25);
  position: relative;
  overflow: hidden;
}

.blogPost-pdf-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blogPost-pdf-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.35);
}

.blogPost-pdf-link:hover::before {
  opacity: 1;
}

.blogPost-pdf-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: #fecaca;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.15);
}

.blogPost-pdf-link:hover .blogPost-pdf-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.blogPost-pdf-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.blogPost-pdf-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.blogPost-pdf-sub {
  font-size: 0.85rem;
  opacity: 0.75;
  font-weight: 400;
}

.blogPost-pdf-arrow {
  font-size: 1.1rem;
  opacity: 0.6;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.blogPost-pdf-link:hover .blogPost-pdf-arrow {
  opacity: 1;
  transform: translateX(4px);
}

@media (max-width: 600px) {
  .blogPost-pdf-link {
    padding: 1rem 1.25rem;
    gap: 1rem;
  }
  .blogPost-pdf-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  .blogPost-pdf-label {
    font-size: 0.95rem;
  }
  .blogPost-pdf-sub {
    font-size: 0.8rem;
  }
}

/* =========================================
   BLOG INTERACTIONS: RATINGS & COMMENTS
========================================= */

/* --- Interaction Container --- */
.blog-interactions {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid #e2e8f0;
}

/* --- Star Rating Section --- */
.blog-rating-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.blog-rating-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.rating-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.rating-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}

.rating-stars-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rating-star {
  font-size: 2.2rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-text-stroke: 1px #94a3b8;
  user-select: none;
}

.rating-star:hover {
  transform: scale(1.25);
}

.rating-star.hovered {
  color: #fbbf24;
  -webkit-text-stroke: 1px #f59e0b;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
  transform: scale(1.15);
}

.rating-star.active {
  color: #f59e0b;
  -webkit-text-stroke: 1px #d97706;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.35));
}

.rating-star.disabled {
  cursor: default;
  pointer-events: none;
}

.rating-star.disabled:hover {
  transform: none;
}

.rating-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}

.rating-avg-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f59e0b;
  line-height: 1;
}

.rating-count {
  font-size: 0.85rem;
  color: #94a3b8;
}

.rating-user-info {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #6366f1;
  font-weight: 500;
}

.rating-login-cta {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.rating-login-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* Star animation on rate */
@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.rating-star.just-rated {
  animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Comments Section --- */
.blog-comments-section {
  margin-bottom: 2rem;
}

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

.comments-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comments-title i {
  color: var(--primary, #1e3a8a);
  font-size: 1.1rem;
}

.comments-count-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  border: 1px solid #e2e8f0;
}

/* Comment Form */
.comment-form-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.3s ease;
}

.comment-form-card:focus-within {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
  border-color: #c7d2fe;
}

.comment-form-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment-form-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-form-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-form-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
}

.comment-textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: #334155;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
  background: #fafbfc;
  box-sizing: border-box;
}

.comment-textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  background: white;
}

.comment-textarea::placeholder {
  color: #94a3b8;
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.comment-char-count {
  font-size: 0.78rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.comment-char-count.warning {
  color: #f59e0b;
}

.comment-char-count.danger {
  color: #ef4444;
  font-weight: 600;
}

.comment-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.comment-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-submit-btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login CTA for comments */
.comment-login-cta {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.comment-login-cta p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.comment-login-cta .comment-login-note {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Individual Comment */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  display: flex;
  gap: 0.85rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
  animation: commentSlideIn 0.3s ease-out;
}

@keyframes commentSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-item:hover {
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
}

/* Verified Badges */
.comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.2px;
}

.comment-badge-medico {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
  border: 1px solid #86efac;
}

.comment-badge-medico i {
  color: #16a34a;
}

.comment-badge-estudiante {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.comment-badge-estudiante i {
  color: #2563eb;
}

.comment-badge-admin {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #9d174d;
  border: 1px solid #f9a8d4;
}

.comment-badge-admin i {
  color: #db2777;
}

.comment-specialty {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

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

.comment-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #334155;
  word-break: break-word;
}

.comment-delete-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0;
}

.comment-item:hover .comment-delete-btn {
  opacity: 1;
}

.comment-delete-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Empty comments state */
.comments-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #94a3b8;
}

.comments-empty i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: #cbd5e1;
}

.comments-empty p {
  font-size: 0.95rem;
  font-weight: 500;
}

.comments-empty .comments-empty-sub {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-top: 0.25rem;
}

/* Toast notification */
.blog-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.blog-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.blog-toast.success { background: linear-gradient(135deg, #059669, #047857); }
.blog-toast.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.blog-toast.warning { background: linear-gradient(135deg, #d97706, #b45309); }

/* Rating badge on category cards */
.carticle-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  color: #a16207;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

.carticle-rating-badge i {
  color: #f59e0b;
  font-size: 0.72rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .blog-rating-section {
    padding: 1.5rem 1rem;
  }
  .rating-star {
    font-size: 1.8rem;
  }
  .comment-form-card {
    padding: 1rem;
  }
  .comment-item {
    padding: 1rem;
  }
  .comment-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
  .comment-author-row {
    gap: 0.3rem;
  }
  .comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .rating-stars-container {
    gap: 0.3rem;
  }
  .rating-star {
    font-size: 1.5rem;
  }
  .comment-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
  }
}

/* =========================================
   REPLIES & LIKES & SCROLL BUTTON
========================================= */

/* --- Comment Actions Row --- */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

/* Like Button */
.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.comment-like-btn:hover {
  background: #fef2f2;
  color: #f43f5e;
}

.comment-like-btn.liked {
  color: #f43f5e;
  font-weight: 600;
}

.comment-like-btn.liked i {
  animation: heartPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.comment-like-count {
  font-size: 0.8rem;
  color: inherit;
}

/* Reply Button */
.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.comment-reply-btn:hover {
  background: #f0f4ff;
  color: #6366f1;
}

/* --- Replies Thread --- */
.comment-replies {
  margin-left: 2.5rem;
  margin-top: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid #e2e8f0;
}

.comment-replies .comment-item {
  background: #f8fafc;
  border-color: #eef2f7;
  padding: 1rem;
}

.comment-replies .comment-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.comment-replies .comment-author-name {
  font-size: 0.85rem;
}

.comment-replies .comment-text {
  font-size: 0.88rem;
}

.reply-mention {
  font-size: 0.8rem;
  color: #6366f1;
  background-color: #e0e7ff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
  font-weight: 500;
}

.load-more-btn {
  background: white;
  color: #6366f1;
  border: 1px solid #e0e7ff;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.05);
}

.load-more-btn:hover {
  background: #f0f4ff;
  border-color: #c7d2fe;
}

.load-more-btn:active {
  transform: translateY(1px);
}

/* Inline Reply Form */
.reply-form-inline {
  margin-left: 2.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  animation: commentSlideIn 0.25s ease-out;
}

.reply-form-inline textarea {
  flex: 1;
  min-height: 50px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #334155;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  box-sizing: border-box;
}

.reply-form-inline textarea:focus {
  border-color: #818cf8;
}

.reply-form-inline textarea::placeholder {
  color: #94a3b8;
}

.reply-submit-btn {
  padding: 0.5rem 0.85rem;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.reply-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.reply-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reply-cancel-btn {
  padding: 0.5rem 0.65rem;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.reply-cancel-btn:hover {
  background: #e2e8f0;
}

/* --- Scroll to Comments FAB --- */
.scroll-to-comments-fab {
  position: fixed;
  bottom: 8rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 999;
  opacity: 0;
  transform: scale(0) translateY(20px);
  pointer-events: none;
}

.scroll-to-comments-fab.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.scroll-to-comments-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.scroll-to-comments-fab .fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f43f5e;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  padding: 0 3px;
}

/* Mobile adjustments for replies */
@media (max-width: 768px) {
  .comment-replies {
    margin-left: 1.25rem;
    padding-left: 0.75rem;
  }
  .reply-form-inline {
    margin-left: 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }
  .reply-form-inline .reply-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }
  .scroll-to-comments-fab {
    bottom: 7.5rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}
