﻿/* ===== VIDEO BACKGROUND ===== */
.video-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
}

/* ===== FEED CONTAINER ===== */
.blog-feed {
    max-width: 500px; /* Chuẩn kích thước IG Desktop */
    margin: 80px auto 0;
    padding: 20px 10px;
    font-family: 'Poppins', sans-serif;
    color: white;
}

.blog-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

    .blog-feed-header h1 {
        font-size: 24px;
        font-family: 'Playfair Display', serif;
    }

.btn-create {
    padding: 8px 15px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* ===== CARD GLASSMORPHISM ===== */
.blog-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Vòng tròn Story IG */
.author-avatar-ring {
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #0f172a;
    object-fit: cover;
    display: block;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-icon {
    color: #00c6ff;
    font-size: 14px;
}

.post-time {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.btn-more {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Image & Animation Tim Nhấp đúp */
.card-image {
    position: relative;
    cursor: pointer;
    user-select: none;
}

    .card-image img {
        width: 100%;
        max-height: 600px;
        object-fit: cover;
        display: block;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

.heart-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 100px;
    color: white;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.5));
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

@keyframes popHeart {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Actions */
.card-actions {
    display: flex;
    align-items: center;
    padding: 10px 15px 5px;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    transition: 0.2s;
    padding: 0;
}

    .action-btn:hover {
        color: #00c6ff;
        transform: scale(1.1);
    }

.spacer {
    flex: 1;
}

.btn-like.liked i {
    color: #ff3b30;
    animation: pop 0.3s;
}

.btn-save.saved i {
    color: #00c6ff;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Info */
.likes-count {
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-caption {
    padding: 0 15px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.author-tag {
    font-weight: 600;
    margin-right: 5px;
}

.hashtag {
    color: #00c6ff;
    cursor: pointer;
    transition: 0.2s;
}

    .hashtag:hover {
        text-decoration: underline;
    }

.view-comments {
    display: block;
    padding: 0 15px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    margin-bottom: 15px;
}

/* Add Comment Form */
.add-comment-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.emoji-icon {
    font-size: 24px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}

.add-comment-form input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 14px;
}

    .add-comment-form input::placeholder {
        color: rgba(255,255,255,0.4);
    }

.btn-post-comment {
    background: none;
    border: none;
    color: #00c6ff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.add-comment-form input:focus ~ .btn-post-comment {
    opacity: 1;
}

/* TOAST */
#toast-notification {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: 0.4s;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
}

    #toast-notification.show {
        bottom: 40px;
        opacity: 1;
    }

/* ===== KHU VỰC BÌNH LUẬN (GLASSMORPHISM) ===== */
.comments-section {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    color: white;
    font-family: 'Poppins', sans-serif;
}

.comments-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

    .comments-title i {
        color: #00c6ff;
        font-size: 1.5rem;
    }

/* ===== AVATAR TỰ ĐỘNG CHỮ CÁI ===== */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.my-avatar {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}

/* ===== FORM NHẬP ===== */
.comment-input-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 30px;
}

.input-box {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 15px;
    transition: 0.3s;
}

    .input-box:focus-within {
        border-color: #00c6ff;
        background: rgba(0,0,0,0.4);
    }

    .input-box textarea {
        width: 100%;
        background: transparent;
        border: none;
        color: white;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        resize: none;
        outline: none;
        padding: 10px 40px 10px 0; /* Chừa khoảng trống bên phải cho nút Gửi */
        min-height: 40px;
    }

        .input-box textarea::placeholder {
            color: rgba(255,255,255,0.4);
        }

.btn-send {
    position: absolute;
    right: 15px;
    bottom: 12px;
    background: none;
    border: none;
    color: #00c6ff;
    font-size: 22px;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-send:hover {
        transform: scale(1.1) rotate(10deg);
        text-shadow: 0 0 10px rgba(0,198,255,0.5);
    }

/* ===== YÊU CẦU ĐĂNG NHẬP ===== */
.login-prompt {
    text-align: center;
    padding: 20px;
    background: rgba(255, 183, 3, 0.1);
    border: 1px dashed rgba(255, 183, 3, 0.4);
    border-radius: 10px;
    margin-bottom: 30px;
    color: rgba(255,255,255,0.8);
}

    .login-prompt i {
        font-size: 24px;
        color: #ffb703;
        margin-bottom: 5px;
    }

    .login-prompt a {
        color: #ffb703;
        text-decoration: none;
        font-weight: 600;
    }

        .login-prompt a:hover {
            text-decoration: underline;
        }

/* ===== DANH SÁCH BÌNH LUẬN ===== */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    display: flex;
    gap: 15px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.comment-time {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.comment-text {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    margin: 0;
}

/* CHƯA CÓ BÌNH LUẬN */
.no-comments {
    text-align: center;
    padding: 30px 0;
    color: rgba(255,255,255,0.4);
}

    .no-comments i {
        font-size: 40px;
        margin-bottom: 10px;
        opacity: 0.5;
    }

/* ===== WRAPPER TRANG CHI TIẾT (FIX LỖI NAVBAR ĐÈ) ===== */
.blog-detail-wrapper {
    padding-top: 120px; /* Đẩy nội dung xuống dưới Navbar */
    padding-bottom: 60px;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 800px; /* Độ rộng hoàn hảo cho việc đọc báo/blog */
    margin: 0 auto; /* Căn giữa màn hình */
}

/* Đảm bảo comment section giãn hết chiều ngang của wrapper */
.comments-section {
    width: 100%;
    margin: 0; /* Xóa margin cũ để wrapper tự quản lý */
}

/* ===== COMMENT ACTIONS (Nút Sửa / Xóa) ===== */
.comment-header {
    display: flex;
    justify-content: space-between; /* Đẩy bộ nút sang bên phải */
    align-items: flex-start;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.comment-actions {
    display: flex;
    gap: 8px;
    opacity: 0; /* Ẩn đi cho đỡ rối mắt */
    transition: opacity 0.3s;
}

/* Hiện nút bấm khi rê chuột vào bình luận */
.comment-item:hover .comment-actions {
    opacity: 1;
}

.btn-action {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    color: rgba(255,255,255,0.4);
}

    .btn-action.edit:hover {
        color: #00c6ff;
        transform: scale(1.2);
    }

    .btn-action.delete:hover {
        color: #ff3b30;
        transform: scale(1.2);
    }

/* ===== KHUNG INLINE EDIT ===== */
.edit-comment-form {
    margin-top: 5px;
}

.edit-box {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .edit-box textarea {
        min-height: 60px;
        padding: 0;
    }

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
}

    .btn-cancel:hover {
        color: white;
        text-decoration: underline;
    }

.btn-save {
    background: #00c6ff;
    color: #0f172a;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    transition: 0.2s;
}

    .btn-save:hover {
        background: #0072ff;
        color: white;
    }

/* ===== COMMENT PREVIEW Ở TRANG CHỦ ===== */
.view-comments {
    display: block;
    padding: 0 15px;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    margin-bottom: 5px;
}

    .view-comments:hover {
        text-decoration: underline;
    }

.comment-preview-list {
    padding: 0 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-preview-item {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255,255,255,0.9);
    /* Cắt chữ nếu bình luận dài quá 1 dòng */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-author {
    font-weight: 600;
    margin-right: 5px;
    color: white;
}

.preview-text {
    opacity: 0.85;
}