/* Estilos para el sistema de comentarios */

/* Mention Dropdown */
.mention-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
    display: block !important;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.mention-item:last-child {
    border-bottom: none;
}

.mention-item:hover,
.mention-item.active {
    background-color: #f0f0f0;
}

.mention-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.mention-item span {
    font-size: 14px;
    color: #333;
}

/* Comments Section */
.comments-section {
    background: #f8f9fa;
    padding: 40px 0;
    border-radius: 15px;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}

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

.comments-title {
    padding-left: 15px;
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.comments-count {
    padding: 0 15px;
    color: #666;
    font-size: 14px;
}

/* Autenticación */
.auth-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.login-prompt {
    margin-bottom: 15px;
    color: #666;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.google-login-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.google-login-btn:hover {
    background: #3367d6;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background: #c82333;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    padding-left: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

#user-info span {
    background: linear-gradient(to right, #ecc465, #b97a35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.user-info span {
    color: #333;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Botón de like del post */
.post-like-section {
    margin: 30px 0;
    text-align: center;
}

.like-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.like-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.like-btn.liked {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

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

/* Formulario de comentarios */
.comment-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-actions button[type="submit"] {
    background: #4285f4;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: #3367d6;
}

.form-actions button[type="button"] {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.form-actions button[type="button"]:hover {
    background: #e9ecef;
}

/* Lista de comentarios */
.comments-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-comments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 0;
}

.comment {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

.comment-meta {
    display: flex;
    flex-direction: column;
}

.comment-author {
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000;
}

.comment-author-name {
    flex: 1;
}

.comment-date {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.comment-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.mention {
    color: #4285f4;
    font-weight: 500;
    background: rgba(66, 133, 244, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.comment-like-btn,
.reply-btn,
.delete-comment-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-like-btn:hover,
.reply-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.comment-like-btn.liked {
    color: #ff6b6b;
}

.delete-comment-btn {
    color: #dc3545;
}

.delete-comment-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.comment-like-btn:disabled,
.reply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Respuestas */
.replies-container {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #f0f0f0;
    display: none;
}

.replies-container.show {
    display: block;
}

/* Respuestas anidadas (respuestas a respuestas) */
.reply .replies-container {
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
    margin-top: 10px;
}

.reply .reply {
    background: #f0f1f3;
    border: 1px solid #d6d8db;
    margin-bottom: 8px;
    padding: 12px;
}

.reply .reply .comment-avatar {
    width: 28px;
    height: 28px;
}

.toggle-replies-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 0;
    margin-top: 5px;
    text-decoration: underline;
}

.toggle-replies-btn:hover {
    color: #0056b3;
}

.reply {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.reply .comment-avatar {
    width: 32px;
    height: 32px;
}

.reply-form-container {
    margin-top: 15px;
}

.reply-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background: linear-gradient(135deg, #01063E 0%, #0b2a9c 100%);
    margin: 10% auto;
    padding: 30px;
    border: 2px solid #ecc465;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 0 30px rgba(236, 196, 101, 0.3);
    position: relative;
}

/* Centrar modal en móviles */
@media (max-width: 768px) {
    .auth-modal {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    .auth-modal[style*="block"] {
        display: flex !important;
    }
    
    .auth-modal-content {
        margin: 0;
        width: 100%;
        max-width: 350px;
        padding: 25px;
    }
    
    .auth-modal h2 {
        font-size: 1.5rem;
    }
    
    .auth-modal p {
        font-size: 0.9rem;
    }
    
    .auth-modal .google-login-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

.auth-modal-close {
    color: #ecc465;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #ecc465;
}

.auth-modal h2 {
    color: #ecc465;
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(236, 196, 101, 0.5);
}

.auth-modal p {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.auth-modal .google-login-btn {
    background: linear-gradient(45deg, #ecc465, #b97a35);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    text-decoration: none;
}

.auth-modal .google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.auth-modal .google-login-btn i {
    font-size: 18px;
}

/* Delete Confirmation Modal Buttons */
.delete-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.delete-confirm-btn {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.delete-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    background: linear-gradient(45deg, #c82333, #a71e2a);
}

.delete-cancel-btn {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.delete-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(45deg, #5a6268, #495057);
}

/* Success Notification */
.success-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    z-index: 9999;
    display: none;
    animation: slideInRight 0.5s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 250px;
}

.success-notification.show {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .comments-section {
        padding: 20px 0;
    }
    
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .google-login-btn {
        width: 100%;
        justify-content: center;
    }
    
    .comment,
    .reply {
        padding: 15px;
    }
    
    .replies-container {
        padding-left: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-avatar {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Animaciones */
.comment,
.reply {
    animation: fadeIn 0.3s ease-in;
}

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

/* Estados de carga */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}