/* Mini Login — Floating widget (góc trên phải) */
#mini-login-widget {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    font-family: inherit;
}

/* Login buttons khi chưa login */
.ml-login-box {
    display: flex;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 4px 6px 4px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    align-items: center;
}
.ml-login-box .ml-login-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    margin-right: 4px;
}
.ml-login-box a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.15s;
}
.ml-login-box a:hover { transform: scale(1.1); }
.ml-login-box .ml-google { background: #fff; border: 1px solid #e5e7eb; }
.ml-login-box .ml-discord { background: #5865f2; }

/* User box khi đã login */
.ml-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}
.ml-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}
.ml-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.ml-user-name:hover { color: #c62828; }

/* Bell icon */
.ml-bell {
    position: relative;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}
.ml-bell:hover { background: #f3f4f6; }
.ml-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}
.ml-bell-badge.hidden { display: none; }

/* Dropdown */
.ml-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 400px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: none;
}
.ml-dropdown.open { display: block; }
.ml-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 700;
    font-size: 14px;
    color: #374151;
}
.ml-mark-all {
    font-size: 11px;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
}
.ml-mark-all:hover { color: #c62828; }
.ml-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
}
.ml-notif-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    transition: background 0.15s;
}
.ml-notif-item:hover { background: #f9fafb; }
.ml-notif-item.unread { background: #fef2f2; }
.ml-notif-item.unread:hover { background: #fee2e2; }
.ml-notif-author { font-weight: 700; color: #c62828; }
.ml-notif-snippet { color: #6b7280; font-size: 12px; margin: 2px 0; }
.ml-notif-time { color: #9ca3af; font-size: 11px; }
.ml-notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* Settings modal */
.ml-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ml-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.ml-modal h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
}
.ml-modal label { font-size: 13px; color: #6b7280; display: block; margin-bottom: 6px; }
.ml-modal input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.ml-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.ml-modal button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.ml-btn-save { background: #c62828; color: #fff; }
.ml-btn-save:hover { background: #8c0c0c; }
.ml-btn-cancel { background: #f3f4f6; color: #374151; }
.ml-btn-logout { background: #fff; color: #6b7280; border: 1px solid #e5e7eb !important; margin-right: auto; }
.ml-btn-logout:hover { color: #dc2626; border-color: #dc2626 !important; }
.ml-msg { font-size: 12px; margin-top: 8px; min-height: 16px; }
.ml-msg.err { color: #dc2626; }
.ml-msg.ok { color: #16a34a; }

/* Mobile */
@media (max-width: 600px) {
    #mini-login-widget { top: 8px; right: 8px; }
    .ml-user-name { max-width: 80px; }
    .ml-dropdown { width: calc(100vw - 16px); right: -4px; }
}

/* ═══════════════════════════════════════════════════════════════
   COMMENT FORM UI
   ═══════════════════════════════════════════════════════════════ */

/* Login prompt (chưa login) */
.mlc-login-prompt {
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border: 2px solid #fecaca;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    margin: 16px 0;
}
.mlc-login-icon {
    font-size: 40px;
    margin-bottom: 8px;
}
.mlc-login-title {
    font-size: 20px;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 6px;
}
.mlc-login-desc {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}
.mlc-login-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}
.mlc-login-btns a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.12s, box-shadow 0.12s;
    border: 1px solid transparent;
}
.mlc-login-btns a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.mlc-btn-google {
    background: #fff !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
}
.mlc-btn-discord {
    background: #5865f2 !important;
    color: #fff !important;
}

/* User info bar (đã login) — trên form comment */
.mlc-me {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.mlc-avatar, .mlc-avatar-ph {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}
.mlc-avatar-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: #c62828;
    font-size: 16px;
}
.mlc-me-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}
.mlc-me-name {
    font-weight: 700;
    font-size: 14px;
    color: #374151;
}
.mlc-me-actions {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}
.mlc-me-actions a {
    color: #6b7280 !important;
    text-decoration: none !important;
}
.mlc-me-actions a:hover { color: #c62828 !important; }

/* Upload avatar trong modal */
.ml-modal-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.ml-modal-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}
.ml-modal-avatar-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
}
.ml-modal-avatar-btn:hover { background: #f9fafb; }
