/* ========================================================
   FLECHAS - MÓDULO COMUNIDAD CRISTIANA
   Edificación Espiritual, Consejos para la Juventud & Recomendaciones
   ======================================================== */

:root {
    --primary: #e11d48;
    --primary-dark: #be123c;
    --primary-light: #ffe4e6;
    --secondary: #8b5cf6;
    --secondary-light: #f3e8ff;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --emerald: #10b981;
    --emerald-light: #d1fae5;
    --teal: #0d9488;
    --teal-light: #ccfbf1;
    
    --bg-body: #fdfaf7;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #f1e7e2;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 4px 20px -2px rgba(225, 29, 72, 0.08);
    --shadow-hover: 0 12px 28px -4px rgba(225, 29, 72, 0.14);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========================================================
   CABECERA PRINCIPAL & HUB DE NAVEGACIÓN
   ======================================================== */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.2);
}

.brand-text h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.brand-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}

/* Hub de Navegación */
.nav-hub {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid #e2e8f0;
}

.nav-hub-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.nav-hub-link:hover {
    color: var(--primary);
    background: rgba(225, 29, 72, 0.06);
}

.nav-hub-link.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
}

/* Menú de Usuario */
.user-menu-area {
    position: relative;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-badge:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), #fb7185);
    color: #ffffff;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-text-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-greeting {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
}

/* User dropdown */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    display: none;
    z-index: 110;
}

.user-dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.d-user-email {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.d-user-role {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 4px;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
}

.dropdown-item.text-danger {
    color: #e11d48;
}

/* ========================================================
   CONTENEDOR PRINCIPAL & HERO DE COMUNIDAD
   ======================================================== */
.community-container {
    max-width: 1040px;
    margin: 24px auto;
    padding: 0 20px;
}

.community-hero {
    background: linear-gradient(135deg, #fff5f5 0%, #fffbf0 50%, #fef3c7 100%);
    border: 1.5px solid #fecdd3;
    border-radius: var(--radius-xl);
    padding: 32px 30px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(225, 29, 72, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 1rem;
    color: #475569;
    max-width: 680px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.hero-verse-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-left: 4px solid var(--primary);
    padding: 12px 18px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 18px;
}

.hero-verse-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #881337;
    margin-bottom: 4px;
}

.hero-verse-ref {
    font-size: 0.78rem;
    font-weight: 700;
    color: #be123c;
}

.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #be123c);
    color: #ffffff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
}

/* ========================================================
   FILTROS DE SECCIONES (TABS)
   ======================================================== */
.sections-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 24px;
    scrollbar-width: thin;
}

.section-tab-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.section-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.section-tab-btn.active {
    background: #1e1b4b;
    border-color: #1e1b4b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 27, 75, 0.25);
}

.section-tab-btn.active.tab-edificacion {
    background: linear-gradient(135deg, #e11d48, #be123c);
    border-color: #e11d48;
}

.section-tab-btn.active.tab-recomendaciones {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

.section-tab-btn.active.tab-juventud {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

/* ========================================================
   BOTÓN DE ACCESO RÁPIDO ADMINISTRADOR (HEADER)
   ======================================================== */
.btn-quick-admin {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-quick-admin:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-quick-admin.active {
    background: #1e1b4b;
    color: #fbbf24;
    border: 1px solid #fbbf24;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.3);
}

/* ========================================================
   CAJA DEL CREADOR (SUBIR FOTOS & POSTS - SIEMPRE VISIBLE)
   ======================================================== */
.creator-box-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px 20px;
    margin-bottom: 26px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.creator-box-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: #fecdd3;
}

.creator-box-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.creator-box-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1b4b, #e11d48);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(30, 27, 75, 0.2);
}

.creator-box-trigger {
    flex: 1;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-full);
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.creator-box-trigger:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.1);
}

.creator-box-placeholder {
    font-size: 0.92rem;
    color: #64748b;
    font-weight: 500;
}

.creator-box-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 12px 0 8px 0;
}

.creator-box-bottom {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    flex-wrap: wrap;
}

.creator-action-btn {
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.creator-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateY(-1px);
}

/* Distintivos de Administrador en Comentarios */
.comment-bubble.admin-comment {
    border-left: 4px solid #f59e0b;
    background: #fffdfa;
}

.admin-badge-pill {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.admin-commenting-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b45309;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.76rem;
    border: 1px solid #fde68a;
}

/* ========================================================
   FEED DE TARJETAS DE PUBLICACIÓN
   ======================================================== */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.post-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
}

.post-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.2);
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-name {
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--text-main);
}

.admin-crown-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-date {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.section-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pill-edificacion {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.pill-recomendaciones {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.pill-juventud {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

/* Contenido de la Publicación */
.post-body {
    padding: 0 24px 18px 24px;
}

.post-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-text {
    font-size: 0.96rem;
    color: #334155;
    line-height: 1.7;
    white-space: pre-line;
    margin-bottom: 18px;
}

/* Imagen de la publicación */
.post-image-wrapper {
    margin: 0 -24px 18px -24px;
    background: #090d16;
    max-height: 560px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain; /* Nunca recortar versículos ni texto de la imagen */
    display: block;
    cursor: zoom-in;
    transition: transform 0.25s ease;
    background: #090d16;
}

.post-image-wrapper:hover img {
    transform: scale(1.015);
}

.post-image-wrapper::after {
    content: '🔍 Clic para ampliar imagen';
    position: absolute;
    bottom: 8px;
    right: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
}

.post-image-wrapper:hover::after {
    opacity: 1;
}

/* Botones de Administración de Publicación (Editar y Eliminar) */
.post-admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-post-action {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-edit-post {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-edit-post:hover {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.btn-delete-post {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 6px 9px;
}

.btn-delete-post:hover {
    background: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
}

/* Vista previa de imagen en formularios de subida y edición */
.image-preview-box {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px;
    display: none;
    text-align: center;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-remove-preview {
    margin-top: 10px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-remove-preview:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Modal de Zoom de Imagen a Pantalla Completa */
.zoom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    padding: 20px;
}

.zoom-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.zoom-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zoom-modal-img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.zoom-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: #ffffff;
    color: #0f172a;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.zoom-modal-close:hover {
    transform: scale(1.1);
}

/* ========================================================
   SISTEMA DE CALIFICACIÓN DE ESTRELLAS
   ======================================================== */
.rating-summary-bar {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.stars-display {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #f59e0b;
    font-size: 1.1rem;
}

.stars-avg-score {
    font-weight: 800;
    font-size: 1.15rem;
    color: #92400e;
    margin-left: 6px;
}

.stars-total-votes {
    font-size: 0.8rem;
    color: #b45309;
}

/* ========================================================
   DESGLOSE DETALLADO DE ESTRELLAS (ESTILO AMAZON)
   ======================================================== */
.stars-breakdown-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    margin: 14px 0 20px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    max-width: 480px;
}

.stars-breakdown-header {
    margin-bottom: 14px;
}

.stars-header-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.stars-row-icons {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #de7921;
    font-size: 1.2rem;
}

.stars-score-big {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.stars-count-subtitle {
    font-size: 0.86rem;
    color: #475569;
    font-weight: 500;
}

.stars-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.star-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.star-row-label {
    width: 78px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #007185;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.star-row-label:hover {
    color: #c7511f;
    text-decoration: underline;
}

.star-row-track {
    flex: 1;
    height: 18px;
    background: #ffffff;
    border: 1.5px solid #888c8c;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    position: relative;
}

.star-row-fill {
    height: 100%;
    background: #de7921;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.star-row-pct {
    min-width: 42px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #007185;
    flex-shrink: 0;
}

.stars-breakdown-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stars-breakdown-link {
    font-size: 0.82rem;
    color: #007185;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.stars-breakdown-link:hover {
    color: #c7511f;
    text-decoration: underline;
}

/* Botón discreto de eliminar comentario para Administrador Daniel */
.btn-delete-comment {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-comment:hover {
    color: #ef4444;
    background: #fee2e2;
    transform: scale(1.1);
}

/* Selector interactivo de estrellas al comentar */
.star-rating-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.star-rating-picker span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.stars-btn-row {
    display: flex;
    gap: 4px;
}

.star-pick-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}

.star-pick-btn:hover,
.star-pick-btn.active {
    color: #f59e0b;
    transform: scale(1.15);
}

/* ========================================================
   SECCIÓN DE COMENTARIOS Y RESEÑAS
   ======================================================== */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    background: #faf8f6;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.comments-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count-tag {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.comment-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 10px;
}

.comment-author {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comment-stars {
    color: #f59e0b;
    font-size: 0.8rem;
    margin-left: 6px;
}

.comment-text {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
}

/* Formulario para agregar comentario */
.add-comment-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.comment-input-area {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-input-area:focus {
    border-color: var(--primary);
}

.comment-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-send-comment {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-send-comment:hover {
    background: var(--primary-dark);
}

/* ========================================================
   MODAL PARA CREAR PUBLICACIÓN (EXCLUSIVO DANIEL)
   ======================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    max-width: 620px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #cbd5e1;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
}

/* Upload zone */
.image-upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s ease;
}

.image-upload-dropzone:hover {
    border-color: var(--primary);
    background: #fff1f2;
}

.dropzone-icon {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}

.dropzone-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

.image-preview-box {
    margin-top: 12px;
    max-height: 220px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    position: relative;
    display: none;
}

.image-preview-box img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: pointer;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
}

/* Toast */
.toast-box {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e1b4b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.toast-box.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 8px 12px;
    }
    .hero-title {
        font-size: 1.5rem;
    }
    .post-header {
        padding: 14px 16px;
    }
    .post-body {
        padding: 0 16px 14px 16px;
    }
    .post-image-wrapper {
        margin: 0 -16px 14px -16px;
    }
    .comments-section {
        padding: 16px;
    }
    .titles-directory-container {
        padding: 16px;
    }
    .title-item-card {
        padding: 14px 16px;
    }
    .title-item-heading {
        font-size: 1.05rem;
    }
}

/* ========================================================
   DIRECTORIO DE TÍTULOS (TODO EL MURO - SOLO TÍTULOS)
   ======================================================== */
.titles-directory-container {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 26px;
}

.titles-directory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1.5px solid #f1f5f9;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.titles-dir-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.titles-dir-sub {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
}

.titles-count-pill {
    background: #ffe4e6;
    color: #be123c;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    border: 1px solid #fecdd3;
    white-space: nowrap;
}

.titles-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.title-item-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 22px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.title-item-card:hover {
    border-color: #f43f5e;
    box-shadow: 0 8px 24px -4px rgba(225, 29, 72, 0.14);
    transform: translateY(-2px);
    background: #fffcfc;
}

.title-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.title-item-date {
    font-size: 0.76rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.title-item-heading {
    margin: 2px 0 0 0;
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 700;
}

.title-item-link {
    font-family: 'Playfair Display', Georgia, serif;
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.title-item-card:hover .title-item-link {
    color: #e11d48;
}

.title-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.title-item-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    color: #64748b;
    flex-wrap: wrap;
}

.title-item-author {
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.title-item-has-image {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.title-item-comments-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-weight: 600;
}

.title-item-stars {
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.title-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-admin-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-view-post {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 800;
    color: #e11d48;
    transition: all 0.2s ease;
    background: #fff1f2;
    padding: 5px 12px;
    border-radius: 8px;
}

.title-item-card:hover .btn-view-post {
    background: #e11d48;
    color: #ffffff;
    gap: 10px;
}

/* Animación de Resaltado al Navegar a una Publicación */
@keyframes postHighlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.5);
        border-color: #e11d48;
        transform: scale(1.01);
    }
    50% {
        box-shadow: 0 0 25px 6px rgba(225, 29, 72, 0.4);
        border-color: #e11d48;
        transform: scale(1.01);
    }
    100% {
        box-shadow: var(--shadow-soft);
        border-color: var(--border-color);
        transform: scale(1);
    }
}

.highlight-post {
    animation: postHighlightPulse 2.5s ease-out;
}

/* ========================================================
   BOTÓN "MI ARTÍCULO" Y MODAL DE COLABORACIÓN COMUNITARIA
   ======================================================== */

.section-tab-btn.tab-my-article {
    background: linear-gradient(135deg, #e11d48, #be123c);
    border: 1.5px solid #be123c;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(225, 29, 72, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-tab-btn.tab-my-article:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.45);
    border-color: #f43f5e;
}

.section-tab-btn.tab-my-article:active {
    transform: translateY(0);
}

.section-tab-btn.tab-my-article i {
    font-size: 0.95rem;
    animation: gentleWiggle 3s infinite ease-in-out;
}

@keyframes gentleWiggle {
    0%, 80%, 100% { transform: rotate(0deg); }
    85% { transform: rotate(-8deg); }
    95% { transform: rotate(8deg); }
}

/* Modal de Enviar Artículo */
.modal-card-article {
    max-width: 640px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
}

.modal-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffe4e6;
    color: #be123c;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.review-notice-banner .notice-icon {
    font-size: 1.35rem;
    color: #e11d48;
    line-height: 1;
    margin-top: 2px;
}

.review-notice-banner .notice-content strong {
    display: block;
    font-size: 0.88rem;
    color: #9f1239;
    margin-bottom: 4px;
}

.review-notice-banner .notice-content p {
    margin: 0;
    font-size: 0.82rem;
    color: #881337;
    line-height: 1.5;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.btn-submit-article {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
    transition: all 0.2s ease;
}

.btn-submit-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
}

.btn-submit-article:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
