/* Discussion Panel - Warm Premium Design
 * Matches word stories warmth and polish
 *
 * Design System (Warm Light Theme):
 * Uses stone/warm gray tones like sentences panel
 * Typography: Nunito for consistency
 * Generous spacing and subtle shadows
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
.discussion-panel,
.discussion-panel * {
    --surface-0: linear-gradient(180deg, #fafaf9 0%, #f5f5f4 100%);
    --surface-1: rgba(255, 255, 255, 0.7);
    --surface-2: rgba(255, 255, 255, 0.85);
    --surface-3: rgba(28, 25, 23, 0.03);
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-tertiary: #a8a29e;
    --accent: #6366f1;
    --accent-dim: rgba(99, 102, 241, 0.12);
    --accent-subtle: rgba(99, 102, 241, 0.06);
    --border: rgba(28, 25, 23, 0.06);
    --border-light: rgba(28, 25, 23, 0.1);
    --shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.06);
    --shadow-md: 0 4px 16px rgba(28, 25, 23, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --spacing-xs: 6px;
    --spacing-sm: 10px;
    --spacing-md: 14px;
    --spacing-lg: 18px;
    --spacing-xl: 24px;
}

/* ========================================
   PANEL OVERLAY
   ======================================== */
.discussion-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 25, 23, 0.2);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 996;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.discussion-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========================================
   PANEL CONTAINER
   ======================================== */
.discussion-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: linear-gradient(180deg, #fafaf9 0%, #f5f5f4 100%);
    z-index: 997;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(28, 25, 23, 0.15);
    overflow: visible;
    display: flex;
    flex-direction: column;
    font-family: 'Nunito', sans-serif;
}

.discussion-panel.active {
    transform: translate3d(0, 0, 0);
}

/* ========================================
   PANEL HEADER
   ======================================== */
.discussion-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: linear-gradient(135deg, #f5f5f4 0%, #e7e5e4 100%);
}

.discussion-panel-title {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.discussion-panel-close {
    background: rgba(28, 25, 23, 0.04);
    border: none;
    color: var(--text-tertiary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discussion-panel-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.05);
}

/* ========================================
   NICKNAME VIEW (First-time setup)
   ======================================== */
.discussion-nickname-view {
    padding: 48px 24px;
    text-align: center;
}

.nickname-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.nickname-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nickname-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.nickname-form {
    max-width: 320px;
    margin: 0 auto;
}

.nickname-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
    margin-bottom: 12px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nickname-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.nickname-input::placeholder {
    color: var(--text-tertiary);
}

.nickname-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.nickname-submit:hover {
    opacity: 0.9;
}

.nickname-submit:active {
    transform: scale(0.98);
}

/* ========================================
   COMMENT VIEW (Main discussion)
   ======================================== */
.discussion-comment-view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: visible;
    flex: 1;
}

.discussion-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-greeting strong {
    color: var(--text-primary);
    font-weight: 500;
}

.change-nickname-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.change-nickname-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

/* ========================================
   COMMENTS CONTAINER
   ======================================== */
.discussion-comments {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    -webkit-overflow-scrolling: touch;
}

/* Minimal scrollbar */
.discussion-comments::-webkit-scrollbar {
    width: 6px;
}

.discussion-comments::-webkit-scrollbar-track {
    background: transparent;
}

.discussion-comments::-webkit-scrollbar-thumb {
    background: rgba(28, 25, 23, 0.12);
    border-radius: 3px;
}

.discussion-comments::-webkit-scrollbar-thumb:hover {
    background: rgba(28, 25, 23, 0.2);
}

/* ========================================
   COMMENT CARD - Warm & Premium
   ======================================== */
.discussion-comment {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);

    /* Staggered entrance animation */
    animation: commentFadeIn 0.3s ease forwards;
    opacity: 0;

    transition: all 0.2s ease;
}

.discussion-comment:hover {
    background: var(--surface-2);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.discussion-comment.pending {
    opacity: 0.5;
}

/* Staggered animation delays */
.discussion-comment:nth-child(1) { animation-delay: 0ms; }
.discussion-comment:nth-child(2) { animation-delay: 50ms; }
.discussion-comment:nth-child(3) { animation-delay: 100ms; }
.discussion-comment:nth-child(4) { animation-delay: 150ms; }
.discussion-comment:nth-child(n+5) { animation-delay: 200ms; }

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

/* Avatar - Warm gradient like Onigiri */
.discussion-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid rgba(194, 65, 12, 0.12);
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.08);
}

.avatar-emoji {
    line-height: 1;
}

/* Comment Content */
.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.comment-time {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.comment-pending-badge {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-style: italic;
    background: var(--surface-3);
    padding: 2px 8px;
    border-radius: 10px;
}

.comment-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

/* ========================================
   COMMENT ACTIONS - Refined Minimal
   ======================================== */
.comment-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.comment-action-btn {
    min-height: 32px;
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.comment-action-btn:not(:disabled):hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

/* Upvote button */
.upvote-btn:not(:disabled):hover {
    color: var(--accent);
}

.upvote-btn.upvoted {
    color: var(--accent);
}

.upvote-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

.upvote-icon {
    display: inline-block;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.upvote-btn.pulse .upvote-icon {
    animation: upvotePop 0.25s ease;
}

@keyframes upvotePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.upvote-count {
    min-width: 10px;
    text-align: center;
}

/* Reply button */
.reply-btn:not(:disabled):hover {
    color: var(--accent);
}

/* ========================================
   REPLY THREADING
   ======================================== */
.discussion-comment.is-reply {
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid var(--accent-dim);
    background: rgba(255, 255, 255, 0.3);
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    box-shadow: none;
}

.discussion-comment.is-reply:hover {
    background: rgba(99, 102, 241, 0.08);
}

.discussion-comment.is-reply .discussion-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

/* Reply input container */
.reply-input-container {
    margin-left: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-left: 2px solid var(--accent);
    margin-bottom: 8px;
    animation: replyFadeIn 0.15s ease;
    border-radius: 0 8px 8px 0;
}

@keyframes replyFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reply-to-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.reply-to-label strong {
    color: var(--accent);
}

.reply-cancel-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.reply-cancel-btn:hover {
    color: var(--text-secondary);
}

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

.reply-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.reply-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.reply-textarea::placeholder {
    color: var(--text-tertiary);
}

.reply-submit-btn {
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.reply-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.reply-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile replies */
@media (max-width: 768px) {
    .discussion-comment.is-reply {
        margin-left: 12px;
    }

    .reply-input-container {
        margin-left: 12px;
    }

    .reply-form {
        flex-direction: column;
    }

    .reply-submit-btn {
        width: 100%;
    }
}

/* ========================================
   COMMENT INPUT AREA - Clean & Focused
   ======================================== */
.discussion-comment-input {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.comment-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Clean textarea */
.comment-textarea {
    flex: 1;
    padding: 12px 44px 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    height: 44px;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.comment-textarea::placeholder {
    color: var(--text-tertiary);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Clean send button */
.comment-submit {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    height: 44px;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.comment-submit:hover:not(:disabled) {
    opacity: 0.9;
}

.comment-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.comment-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.comment-submit.loading {
    opacity: 0.6;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.discussion-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 500;
}

.empty-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ========================================
   LOADING STATE
   ======================================== */
.discussion-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

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

/* ========================================
   ERROR STATE
   ======================================== */
.discussion-error {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.error-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 500;
}

.error-message {
    color: var(--text-tertiary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.error-retry-btn {
    background: var(--accent);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.error-retry-btn:hover {
    opacity: 0.9;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.discussion-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.discussion-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.discussion-toast.toast-success {
    border-color: rgba(74, 222, 128, 0.3);
}

.discussion-toast.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .discussion-panel {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .discussion-panel-header {
        padding: 16px 20px;
    }

    .discussion-panel-title {
        font-size: 1rem;
    }

    .discussion-comments {
        padding: 12px 16px;
    }

    .discussion-comment {
        padding: 14px;
        gap: 10px;
    }

    .discussion-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .comment-author {
        font-size: 0.85rem;
    }

    .comment-text {
        font-size: 0.9rem;
    }

    .comment-action-btn {
        min-height: 40px;
        padding: 8px 12px;
    }

    .discussion-comment-input {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .comment-form {
        gap: 8px;
    }

    .comment-textarea {
        padding: 10px 40px 10px 12px;
        font-size: 16px; /* Prevent iOS zoom */
        height: 42px;
        min-height: 42px;
    }

    .comment-submit {
        padding: 10px 16px;
        height: 42px;
        font-size: 0.85rem;
    }

    .nickname-input {
        font-size: 16px; /* Prevent iOS zoom */
    }
}

/* ========================================
   TABLET ADJUSTMENTS
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .discussion-panel {
        max-height: 70vh;
    }

    .discussion-comments {
        padding: 16px 28px;
    }

    .discussion-comment-input {
        padding: 14px 28px;
    }
}

/* ========================================
   HIDE IN VIDEO/REVISION MODES
   ======================================== */
body.video-mode #discussionBtn,
body.revision-mode #discussionBtn {
    display: none !important;
}

body.video-mode .discussion-panel,
body.revision-mode .discussion-panel {
    display: none !important;
}

/* ========================================
   EMOJI PICKER - Minimal & Clean
   ======================================== */
.comment-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

.comment-input-wrapper .comment-textarea {
    padding-right: 44px;
    flex: 1;
}

/* Emoji trigger - subtle */
.emoji-trigger {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
    opacity: 0.5;
}

.emoji-trigger:hover {
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
}

.emoji-trigger:active {
    transform: scale(0.95);
}

.emoji-trigger[aria-expanded="true"] {
    background: var(--accent-dim);
    opacity: 1;
}

/* Picker panel - light frosted glass */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    max-width: 340px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.emoji-picker.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Category tabs - minimal */
.emoji-categories {
    display: flex;
    padding: 8px;
    gap: 2px;
    border-bottom: 1px solid var(--border);
}

.emoji-category-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0.4;
}

.emoji-category-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    opacity: 0.7;
}

.emoji-category-btn.active {
    background: var(--accent-dim);
    opacity: 1;
}

/* Emoji grid - compact */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Emoji items - simple */
.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease, transform 0.1s ease;
    padding: 0;
}

.emoji-item:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(1);
}

/* Empty state */
.emoji-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    min-height: 120px;
}

.emoji-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.emoji-empty-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.emoji-empty-hint {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Minimal scrollbar */
.emoji-grid::-webkit-scrollbar {
    width: 4px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(28, 25, 23, 0.12);
    border-radius: 2px;
}

/* ========================================
   NEW COMMENT INDICATOR - Subtle Dot
   ======================================== */
.discussion-comment.is-new {
    position: relative;
}

/* Simple accent left border instead of glow */
.discussion-comment.is-new::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* NEW badge - minimal pill */
.new-comment-badge {
    position: absolute;
    top: -6px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    z-index: 10;
}

/* Fade out */
.new-comment-badge.fading {
    animation: badgeFade 0.3s ease forwards;
}

@keyframes badgeFade {
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.discussion-comment.is-new.badge-removed::before {
    animation: borderFade 0.5s ease forwards;
}

@keyframes borderFade {
    to { opacity: 0; }
}

/* Mobile emoji picker */
@media (max-width: 768px) {
    .emoji-picker {
        left: 8px;
        right: 8px;
        max-width: none;
    }

    .emoji-grid {
        grid-template-columns: repeat(8, 1fr);
        max-height: 160px;
    }

    .emoji-item {
        font-size: 1.35rem;
    }

    .emoji-trigger {
        width: 34px;
        height: 34px;
        font-size: 1.15rem;
    }
}
