:root {
    --bg-dark: #0a0a0b;
    --sidebar-bg: #121214;
    --text-main: #e1e1e6;
    --text-dim: #a8a8b3;
    --accent: #8257e5;
    --accent-glow: rgba(130, 87, 229, 0.3);
    --bubble-me: #3e3355;
    --bubble-other: #161618;
    --border: #323238;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Kanit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Image Preview Styles */
.image-preview-container {
    position: relative;
    display: inline-block;
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    max-width: 200px;
}

.image-preview {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-image-btn:hover {
    background: rgba(255, 0, 0, 0.7);
}

/* Main Overlay for Drop (Universal) */
.main-chat.dragging .drop-overlay {
    opacity: 1;
    visibility: visible;
}

.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    padding: 30px;
    pointer-events: none;
    /* Allows drop events to pass to parent if needed, but we'll handle on parent */
}

.drop-dashed-box {
    width: 100%;
    height: 100%;
    border: 3px dashed var(--accent);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--accent);
}

.drop-dashed-box .icon {
    font-size: 3rem;
}

.drop-dashed-box p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Chat Main Area */
.main-chat {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
}

.screen.active {
    display: flex;
    opacity: 1;
}

.welcome-box {
    margin: auto;
    text-align: center;
    max-width: 400px;
}

.welcome-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.welcome-box p {
    color: var(--text-dim);
    margin-bottom: 30px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Chat Header */
.chat-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.room-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #04d361;
    border-radius: 50%;
}

.share-link-mini {
    padding: 6px 12px;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    gap: 10px;
}

#shareLinkText {
    color: var(--text-dim);
}

#copyBtn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
}

/* Messages Area */
.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

#messagesWrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    line-height: 1.5;
    font-size: 0.95rem;
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-bubble.me {
    align-self: flex-end;
    background: var(--bubble-me);
    border-bottom-right-radius: 2px;
}

.message-bubble.other {
    align-self: flex-start;
    background: var(--bubble-other);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}

.message-notification {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.8rem;
    padding: 5px 15px;
    border-radius: 20px;
    margin: 10px 0;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Countdown & Metadata */
.message-meta {
    display: flex;
    color: #666565;
    gap: 8px;
    font-size: 0.55rem;
    margin-top: 4px;
}

.me .message-meta {
    justify-content: flex-end;
}

.countdown {
    color: #f75a68;
}

.input-attach-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.input-attach-btn:hover {
    color: var(--accent);
}

.upload-iframe {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: 8px;
    background: transparent;
}

/* Media Content in Bubbles */
.message-media-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    margin: 5px 0;
}

.message-media-container:hover .download-overlay {
    opacity: 1;
}

.message-img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.message-media-container:hover .message-img {
    transform: scale(1.02);
}

.download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}



.file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
}

.file-link:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    max-height: 150px;
    overflow: hidden;
    min-height: 20px;
    line-height: 1.4;
}

#messageInput:focus {
    outline: none;
}

.send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.send-btn:hover {
    background: #9466ff;
}

.notify-btn {
    background: transparent;
    color: var(--text-dim);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
    margin-left: 5px;
}

.notify-btn:hover {
    color: var(--accent);
    background: rgba(130, 87, 229, 0.1);
}

/* Upload Modal */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--sidebar-bg);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.upload-modal.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.modal-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#modalFileName {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 25px;
    word-break: break-all;
}

.modal-progress-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.modal-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transition: width 0.3s ease;
}

#modalStatus {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        padding: 0;
        overflow: hidden;
        border-right: none;
    }

    .sidebar.open {
        width: 280px;
        padding: 20px;
    }

    .message-bubble {
        max-width: 85%;
    }
}



.copyable-id {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.copyable-id:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent);
}

.copyable-id:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.1);
}

/* Toast feedback for copying */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.qr-container {
    position: relative;
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.qr-container:hover {
    transform: scale(1.02);
}

.qr-container img.qr-image {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}

.qr-download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

.qr-container:hover .qr-download-overlay {
    opacity: 1;
}

.qr-download-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.qr-container:active .qr-download-icon {
    transform: scale(0.9);
}

/* ===== Voice Broadcast System ===== */

/* Broadcast Button */
.voice-broadcast-btn {
    position: relative;
    transition: all 0.3s ease !important;
}

.voice-broadcast-btn.broadcasting {
    color: #a855f7 !important;
    background: rgba(168, 85, 247, 0.15) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4), 0 0 30px rgba(168, 85, 247, 0.2);
}

@keyframes broadcastPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    }

    50% {
        transform: scale(1.12);
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.6), 0 0 50px rgba(168, 85, 247, 0.3);
    }
}

.voice-broadcast-btn.broadcasting {
    animation: broadcastPulse 1.5s ease-in-out infinite;
}

/* Voice Listener Bar */
.voice-listener-bar {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.4s ease;
    max-height: 60px;
    opacity: 1;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(120, 0, 255, 0.12), rgba(0, 220, 180, 0.08));
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}

.voice-listener-bar.hidden {
    display: none !important;
}

.voice-listener-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    height: 50px;
}

.voice-listener-text {
    font-size: 0.82rem;
    color: #c084fc;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    animation: listenerTextGlow 2s ease-in-out infinite alternate;
}

@keyframes listenerTextGlow {
    from {
        text-shadow: 0 0 5px rgba(192, 132, 252, 0.3);
    }

    to {
        text-shadow: 0 0 15px rgba(192, 132, 252, 0.7), 0 0 30px rgba(168, 85, 247, 0.3);
    }
}

/* Animated Wave Bars */
.voice-wave-container {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.voice-wave-container .wave-bar {
    width: 3px;
    background: linear-gradient(180deg, #a855f7, #06d6a0);
    border-radius: 3px;
    animation: waveAnim 1s ease-in-out infinite;
}

.voice-wave-container .wave-bar:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.voice-wave-container .wave-bar:nth-child(2) {
    height: 16px;
    animation-delay: 0.12s;
}

.voice-wave-container .wave-bar:nth-child(3) {
    height: 22px;
    animation-delay: 0.24s;
}

.voice-wave-container .wave-bar:nth-child(4) {
    height: 14px;
    animation-delay: 0.36s;
}

.voice-wave-container .wave-bar:nth-child(5) {
    height: 10px;
    animation-delay: 0.48s;
}

@keyframes waveAnim {

    0%,
    100% {
        transform: scaleY(0.4);
        opacity: 0.6;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Voice Visualizer Canvas */
#voiceVisualizer {
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Broadcast Active Indicator in Chat Header */
.dot.broadcasting {
    background: #a855f7 !important;
    animation: dotBroadcast 1s ease-in-out infinite;
}

@keyframes dotBroadcast {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.6);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(168, 85, 247, 0);
    }
}

/* ===== Annotation Mark Modal ===== */
.annotate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 10000;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.annotate-modal.active {
    display: flex;
    opacity: 1;
}

.annotate-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.annotate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.annotate-header h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.annotate-header h3 i {
    color: #ef4444;
}

.annotate-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.annotate-close-btn:hover {
    background: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.annotate-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.annotate-canvas-container {
    position: relative;
    display: inline-block;
    background: #1a1a2e;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    overflow: visible;
}

.annotate-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Annotation Box */
.annotate-canvas-container .ann-box {
    position: absolute;
    border: 3px dashed #ef4444;
    background: rgba(239, 68, 68, 0.1);
    min-width: 60px;
    min-height: 60px;
    cursor: grab;
    user-select: none;
    z-index: 2;
    border-radius: 8px;
    box-sizing: border-box;
    touch-action: none;
    transition: border-color 0.2s, background 0.2s;
}

.ann-box:active {
    cursor: grabbing;
}

/* Resize Handles */
.ann-box .ann-resizer {
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid #ef4444;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 5;
    touch-action: none;
}

.ann-resizer.tl {
    top: -11px;
    left: -11px;
    cursor: nwse-resize;
}

.ann-resizer.tr {
    top: -11px;
    right: -11px;
    cursor: nesw-resize;
}

.ann-resizer.bl {
    bottom: -11px;
    left: -11px;
    cursor: nesw-resize;
}

.ann-resizer.br {
    bottom: -11px;
    right: -11px;
    cursor: nwse-resize;
}

/* Delete Button */
.ann-box .ann-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #ef4444;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.5);
    border: 2px solid white;
    transition: transform 0.2s;
}

.ann-close:active {
    transform: scale(0.9);
}

/* Text Label */
.ann-box .ann-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
    white-space: pre-wrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    outline: none;
    cursor: text;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.ann-label:empty::before {
    content: "แก้อะไรดี?บอกมา";
    color: #94a3b8;
}

.ann-label::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(30, 41, 59, 0.95) transparent;
}

/* Exporting mode - hide UI */
.annotate-canvas-container.exporting .ann-resizer,
.annotate-canvas-container.exporting .ann-close,
.annotate-canvas-container.exporting .ann-label.is-empty,
.annotate-canvas-container.exporting .ann-label.is-empty::after {
    display: none !important;
}

/* Toolbar */
.annotate-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.annotate-btn {
    border: none;
    border-radius: 100px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: 'Inter', 'Kanit', sans-serif;
}

.annotate-btn:active {
    transform: scale(0.93);
}

.annotate-btn-tool {
    background: #fee2e2;
    color: #ef4444;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.annotate-btn-tool:hover {
    background: #fecaca;
    transform: translateY(-2px);
}

.annotate-btn-send {
    background: linear-gradient(135deg, #8257e5, #6c3fd1);
    color: white;
    box-shadow: 0 6px 18px rgba(130, 87, 229, 0.4);
    opacity: 0.3;
    cursor: not-allowed;
}

.annotate-btn-send.ready {
    opacity: 1;
    cursor: pointer;
}

.annotate-btn-send.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(130, 87, 229, 0.5);
}

.annotate-toolbar-divider {
    width: 2px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
}

/* Mark Button on Image Bubbles */
.mark-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 12px;
    border: none;
    border-radius: 100px;
    background: rgba(14, 165, 233, 0.15);
    /* light blue */
    color: #0ea5e9;
    /* blue text */
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', 'Kanit', sans-serif;
}

.mark-image-btn:hover {
    background: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
    transform: translateY(-1px);
}

.mark-image-btn:active {
    transform: scale(0.95);
}

@keyframes annPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    70% {
        transform: scale(1.04);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.annotate-btn-tool.pulse {
    animation: annPulse 1.5s infinite;
    background: #fff1f2 !important;
    border: 2px solid #fb7185 !important;
    color: #e11d48 !important;
}

@media (max-width: 600px) {
    .annotate-toolbar {
        padding: 12px 16px;
    }

    .annotate-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* ===== Marked Image Styles ===== */
.marked-image-wrapper {
    position: relative;
    border: 2px solid #eab308;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(234, 179, 8, 0.08);
    margin: 5px 0;
}

.marked-tag {
    display: inline-block;
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-bottom-right-radius: 8px;
    letter-spacing: 0.3px;
}

.marked-media {
    cursor: zoom-in !important;
}

.marked-media .message-img {
    border-radius: 0 !important;
}

/* ===== Image Lightbox Popup ===== */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    display: flex;
    opacity: 1;
}

.image-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}