/* ========== COMMENT SYSTEM ========== */

/* Floating Button - z-index cao nhất */
.comment-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0969da, #0550ae);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: 0 4px 16px rgba(9, 105, 218, 0.4);
    z-index: 99999;
    transition: all 0.2s ease;
}

.comment-float-btn:hover {
    background: linear-gradient(135deg, #0550ae, #033d8b);
    box-shadow: 0 6px 20px rgba(9, 105, 218, 0.5);
}

.comment-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #cf222e;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal - z-index cao nhất */
.comment-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
}

.comment-modal.active {
    display: flex;
}

.comment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.comment-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.comment-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.comment-modal-header h4 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #24292f;
    margin: 0;
}

.comment-modal-header h4 i {
    color: #0969da;
}

.comment-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #57606a;
    font-size: 16px;
}

.comment-modal-close:hover {
    background: #e1e4e8;
    color: #24292f;
}

.comment-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Page Info */
.comment-page-info {
    padding: 10px 14px;
    background: #f0f6fc;
    border: 1px solid #c8e1ff;
    border-radius: 8px;
    font-size: 13px;
    color: #0969da;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comment Form */
.comment-form {
    margin-bottom: 20px;
}

.comment-form-row {
    margin-bottom: 12px;
}

.comment-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-size: 14px;
    color: #24292f;
    background: #ffffff;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.comment-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-size: 14px;
    color: #24292f;
    background: #ffffff;
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.comment-textarea::placeholder {
    color: #8b949e;
}

.comment-submit {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0969da, #0550ae);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.comment-submit:hover {
    background: linear-gradient(135deg, #0550ae, #033d8b);
}

.comment-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Divider */
.comment-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 16px;
    gap: 12px;
}

.comment-divider::before,
.comment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e4e8;
}

.comment-divider span {
    font-size: 12px;
    color: #57606a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Comment List */
.comment-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment-empty,
.comment-loading {
    text-align: center;
    padding: 32px 16px;
    color: #57606a;
    font-size: 14px;
}

.comment-item {
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    margin-bottom: 12px;
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #24292f;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-author i {
    color: #0969da;
}

.comment-date {
    font-size: 11px;
    color: #8b949e;
}

.comment-content {
    font-size: 14px;
    color: #24292f;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
    .comment-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }
    
    .comment-modal-dialog {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .comment-float-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}
