/* Estilos para el modal del blog con formulario de comentarios mejorado */

/* Estilos básicos del modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

body.modal-open {
    overflow: hidden;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 30px auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    transform: translateY(20px);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #8E44AD;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#modal-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
    color: #333;
}

#modal-date {
    color: #888;
    font-size: 14px;
}

.modal-body {
    line-height: 1.6;
}

/* Estilos de autor */
.modal-author {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.author-name {
    font-weight: 600;
    color: #333;
}

/* Estilos de likes */
.post-interaction {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.post-likes {
    margin-bottom: 30px;
    text-align: center;
}

.like-button {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 30px;
    transition: all 0.2s ease;
    position: relative;
    outline: none;
}

.like-button:hover {
    background-color: rgba(142, 68, 173, 0.1);
    color: #8E44AD;
}

.like-button i {
    margin-right: 5px;
    transition: transform 0.2s ease;
}

.like-button:hover i {
    transform: scale(1.2);
}

.like-button.liked i {
    color: #e74c3c;
}

@keyframes heart-fly {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(1.5); }
}

/* Estilos de comentarios */
.post-comments-section {
    margin-top: 30px;
}

.post-comments-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.comments-list {
    margin-bottom: 30px;
}

.comment {
    display: flex;
    margin-bottom: 25px;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
}

.comment-avatar {
    flex-shrink: 0;
    margin-right: 15px;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.no-comments {
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    color: #999;
    font-style: italic;
}

.loading-comments {
    text-align: center;
    padding: 10px;
    color: #8E44AD;
    font-weight: 500;
}

.comments-error {
    text-align: center;
    padding: 10px;
    color: #e74c3c;
    font-weight: 500;
}

/* Formulario de comentarios mejorado */
.comment-form-container {
    margin-top: 30px;
}

.comment-form-container h4 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.comment-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
}

.comment-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #8E44AD;
    outline: none;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.comment-submit-btn {
    background-color: #8E44AD;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.comment-submit-btn:hover {
    background-color: #9B59B6;
}

.comment-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Compartir en redes sociales */
.modal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-buttons span {
    color: #666;
    font-size: 14px;
}

.share-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.share-button:hover {
    transform: scale(1.1);
}

#share-facebook {
    background-color: #3b5998;
}

#share-twitter {
    background-color: #1da1f2;
}

#share-whatsapp {
    background-color: #25d366;
}

#copy-link {
    background-color: #8E44AD;
}

/* Estilos para notificaciones */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.success {
    background-color: #2ecc71;
}

.notification.error {
    background-color: #e74c3c;
}

.notification.warning {
    background-color: #f39c12;
}

/* Dark mode */
body.dark-mode .modal-content {
    background-color: #2c2c2c;
    color: #f0f0f0;
}

body.dark-mode #modal-title {
    color: #f0f0f0;
}

body.dark-mode .modal-close {
    color: #aaa;
}

body.dark-mode .modal-header {
    border-bottom-color: #444;
}

body.dark-mode .post-interaction {
    border-top-color: #444;
}

body.dark-mode .modal-footer {
    border-top-color: #444;
}

body.dark-mode .author-name,
body.dark-mode .comment-author {
    color: #f0f0f0;
}

body.dark-mode .like-button {
    color: #ccc;
}

body.dark-mode .like-button:hover {
    background-color: rgba(155, 89, 182, 0.2);
}

body.dark-mode .comment,
body.dark-mode .no-comments,
body.dark-mode .comment-form {
    background-color: #3a3a3a;
}

body.dark-mode .comment-text {
    color: #ddd;
}

body.dark-mode .comment-date {
    color: #aaa;
}

body.dark-mode .form-group label {
    color: #ddd;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background-color: #444;
    border-color: #555;
    color: #f0f0f0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #9B59B6;
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.3);
}

body.dark-mode .share-buttons span {
    color: #ddd;
}

/* Estilos responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
    
    #modal-title {
        font-size: 24px;
    }
    
    .comment {
        flex-direction: column;
    }
    
    .comment-avatar {
        margin-bottom: 10px;
    }
    
    .comment-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .comment-submit-btn {
        width: 100%;
    }
}

/* Estilos para el modal en modo oscuro */
body.dark-mode .modal-content {
    background-color: #1a202c; 
    color: #eaeaea;
    border-color: #2d3748;
}

body.dark-mode .modal-close {
    color: #cbd5e0;
}

body.dark-mode .modal-close:hover {
    color: #ffffff;
}

body.dark-mode .modal-header {
    border-bottom-color: #2d3748;
}

body.dark-mode .modal-footer {
    border-top-color: #2d3748;
}

body.dark-mode .modal-author .author-name {
    color: #e2e8f0;
}

body.dark-mode .share-button {
    background-color: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .share-button:hover {
    background-color: #4a5568;
}

body.dark-mode .comment {
    border-bottom-color: #2d3748;
}

body.dark-mode .comment-author {
    color: #e2e8f0;
}

body.dark-mode .comment-date {
    color: #a0aec0;
}

body.dark-mode .like-button {
    color: #e2e8f0;
}

body.dark-mode .like-button.liked {
    color: #ed64a6;
}

/* Si hay algún input o área de texto dentro del modal, también ajustamos esos estilos */
body.dark-mode .modal-content input,
body.dark-mode .modal-content textarea {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

/* Para el contenido principal del artículo en modo oscuro */
body.dark-mode .modal-content .modal-content {
    color: #e2e8f0;
}

body.dark-mode .modal-content a {
    color: #ffffff;
}

body.dark-mode .modal-content h3,
body.dark-mode .modal-content h4 {
    color: #e2e8f0;
}

body.dark-mode .post-comments-section h3,
body.dark-mode .comment-form-container h4 {
    color: #e2e8f0;
}

/* Para anular cualquier estilo gris que pueda estar siendo aplicado */
body.dark-mode .modal-content {
    background-color: #1a202c !important;
}