/* === FILE: style.css === */
/* Comment Plugin Styles — All classes prefixed .cmt- */

/* === Section chính === */
.cmt-section {
    max-width: 100%;
    padding: 20px 0;
}

.cmt-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.cmt-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmt-title i {
    color: #667eea;
}

/* === Form nhập comment === */
.cmt-form-wrapper {
    margin-bottom: 24px;
}

.cmt-form-container {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cmt-form-avatar img,
.cmt-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.cmt-avatar-sm img {
    width: 32px;
    height: 32px;
}

.cmt-form-body {
    flex: 1;
    min-width: 0;
}

.cmt-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.cmt-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cmt-textarea::placeholder {
    color: #aaa;
}

.cmt-form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cmt-form-buttons {
    display: flex;
    gap: 8px;
}

.cmt-notify-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.cmt-notify-label input[type="checkbox"] {
    margin: 0;
}

/* === Buttons === */
.cmt-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cmt-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.cmt-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.cmt-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.cmt-btn-cancel:hover {
    background: #e0e0e0;
}

.cmt-btn-load-more {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s;
}

.cmt-btn-load-more:hover {
    background: #667eea;
    color: #fff;
}

/* === Login notice === */
.cmt-login-notice {
    background: #f8f9fa;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    border: 1px dashed #ddd;
}

.cmt-login-notice a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.cmt-login-notice a:hover {
    text-decoration: underline;
}

/* === Danh sách comment === */
.cmt-list {
    min-height: 50px;
}

.cmt-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    animation: cmtFadeIn 0.4s ease;
}

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

.cmt-body {
    flex: 1;
    min-width: 0;
}

.cmt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    border-bottom: none;
    padding-bottom: 0;
}

.cmt-author {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}

.cmt-time {
    font-size: 12px;
    color: #999;
    line-height: 1;
}

.cmt-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    word-break: break-word;
    margin-bottom: 8px;
}

/* === Actions (Like, Reply, Edit, Delete) === */
.cmt-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cmt-action-btn {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.cmt-action-btn:hover {
    color: #333;
}

.cmt-like-btn.cmt-liked {
    color: #667eea;
    font-weight: 600;
}

.cmt-like-btn.cmt-liked i {
    color: #667eea;
}

.cmt-like-count {
    font-size: 12px;
}

.cmt-delete-btn:hover {
    color: #e74c3c;
}

.cmt-edit-btn:hover {
    color: #f39c12;
}

/* === Replies === */
.cmt-replies {
    margin-top: 12px;
    padding-left: 15px;
    border-left: 1px solid #f0f0f0;
}

.cmt-reply-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f8f8f8;
    animation: cmtFadeIn 0.4s ease;
}

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

.cmt-reply-form-wrapper {
    margin-top: 10px;
}

.cmt-reply-form {
    margin-top: 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cmt-expand-replies {
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
    transition: color 0.2s;
}

.cmt-expand-replies:hover {
    color: #4a5bc4;
}

/* === Edit form inline === */
.cmt-edit-form {
    width: 100%;
}

.cmt-edit-form .cmt-form-buttons {
    margin-top: 8px;
}

/* === Empty state === */
.cmt-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 15px;
}

.cmt-empty i {
    font-size: 30px;
    display: block;
    margin-bottom: 10px;
    color: #ddd;
}

/* === Loading spinner === */
.cmt-loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.cmt-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: cmtSpin 0.8s linear infinite;
    margin: 0 auto;
}

/* === Toast notification === */
.cmt-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 350px;
}

.cmt-toast-success {
    background: #38c172;
    color: #fff;
}

.cmt-toast-error {
    background: #e74c3c;
    color: #fff;
}

/* === Animations === */
@keyframes cmtFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cmtSpin {
    to {
        transform: rotate(360deg);
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .cmt-replies {
        padding-left: 20px;
    }

    .cmt-form-avatar img,
    .cmt-avatar img {
        width: 32px;
        height: 32px;
    }

    .cmt-actions {
        gap: 10px;
    }

    .cmt-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        max-width: none;
    }

    .cmt-form-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
