/* ========================================
   CSS para Markdown Extendido en Comentarios
   ======================================== */

/* Headers en comentarios */
.comment-header-large {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.25rem;
}

.comment-header-small {
    font-size: 1.1rem;
    font-weight: 600;
    color: #34495e;
    margin: 0.4rem 0;
    border-bottom: 1px solid #95a5a6;
    padding-bottom: 0.15rem;
}

/* Código inline */
.comment-code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85em;
    color: #e83e8c;
}

/* Spoilers */
.spoiler {
    background-color: #6c757d;
    color: transparent;
    cursor: pointer;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
}

.spoiler::before {
    content: "🔍 Spoiler";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    opacity: 0.8;
    pointer-events: none;
}

.spoiler.revealed {
    background-color: transparent;
    color: inherit;
}

.spoiler.revealed::before {
    display: none;
}

.spoiler:hover:not(.revealed) {
    background-color: #5a6268;
}

/* Enlaces en comentarios */
.comment-link {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.comment-link:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
    text-decoration: none;
}

/* Badge para enlaces ocultos */
.comment-hidden-link {
    font-size: 0.75em;
    padding: 0.25rem 0.5rem;
    margin: 0 0.2rem;
    transition: all 0.2s ease;
}

.comment-hidden-link:hover {
    background-color: #dc3545 !important;
    transform: scale(1.05);
}

/* Mejoras para el texto de comentarios */
.comment-text {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 150px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative;
}

.comment-text.expanded {
    max-height: none;
    overflow: visible;
}

/* Gradiente de fade para comentarios largos */
.comment-text:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
}

/* Botón de toggle para expandir/contraer */
.comment-toggle-btn {
    border: none;
    background: none;
    color: #007bff;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.comment-toggle-btn:hover {
    color: #0056b3;
}

.comment-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    border-radius: 2px;
}

/* Estilos para texto subrayado y cursiva adicional */
u {
    text-decoration: underline;
    text-decoration-color: #007bff;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

i {
    font-style: italic;
    color: #495057;
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .comment-header-large {
        font-size: 1.1rem;
    }
    
    .comment-header-small {
        font-size: 1rem;
    }
    
    .comment-code {
        font-size: 0.8em;
        padding: 0.15rem 0.3rem;
    }
    
    .spoiler::before {
        font-size: 0.6em;
    }
}

/* Animaciones suaves */
.comment-text,
.spoiler,
.comment-link,
.comment-hidden-link {
    transition: all 0.2s ease;
}

/* Estilos dark mode compatibles */
@media (prefers-color-scheme: dark) {
    .comment-header-large {
        color: #ecf0f1;
        border-bottom-color: #3498db;
    }
    
    .comment-header-small {
        color: #bdc3c7;
        border-bottom-color: #7f8c8d;
    }
    
    .comment-code {
        background-color: #2c3e50;
        border-color: #34495e;
        color: #e74c3c;
    }
    
    .spoiler {
        background-color: #95a5a6;
    }
    
    .comment-text:not(.expanded)::after {
        background: linear-gradient(transparent, rgba(33, 37, 41, 0.9));
    }
}
