/* Live Chat News - Chat Window Styles */

/* ================================
   STREAM LAYOUT (Video + Chat)
   ================================ */
#lcn-stream-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
    min-height: 100vh;
    background: #0d0d0d;
}

#lcn-video-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#lcn-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    margin: 0;
    overflow: hidden;
}

#lcn-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

#lcn-chat-panel {
    width: 400px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Breaking announcement banner (all screens) */
#lcn-breaking-banner {
    display: none;
    background: linear-gradient(90deg, #ff0000 0%, #cc0000 100%);
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: lcn-breaking-pulse 1s ease-in-out infinite;
    flex-shrink: 0;
    position: relative;
}

#lcn-breaking-banner.lcn-active {
    display: block;
}

@keyframes lcn-breaking-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile: Stack video on top */
@media (max-width: 900px) {
    html, body {
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Kill any theme padding around the shortcode area */
    .elementor-page,
    .elementor-column,
    .elementor-widget-wrap,
    .elementor-widget,
    .entry-content,
    .site-content,
    .post-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    #lcn-stream-layout {
        flex-direction: column;
        height: 100dvh;
        width: 100vw;
        max-width: none !important;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }
    
    #lcn-video-panel {
        width: 100% !important;
        max-height: 25vh;
        flex-shrink: 0;
        overflow: hidden;
    }
    
    #lcn-video-wrapper {
        padding-top: 56.25%;
        width: 100% !important;
    }
    
    #lcn-chat-panel {
        width: 100% !important;
        max-width: none !important;
        flex: 1;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex !important;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    #lcn-chat-container {
        height: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
    }

    /* Messages area fills remaining space */
    #lcn-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        width: 100% !important;
    }
}

/* ================================
   CHAT CONTAINER
   ================================ */
#lcn-chat-container {
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    border-radius: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100%;
}

.lcn-chat-only {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lcn-chat-embedded {
    border-radius: 0;
}

/* Header */
#lcn-chat-header {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Input Area */
#lcn-input-area {
    padding: 12px;
    background: #16213e;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lcn-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.lcn-live-indicator {
    width: 10px;
    height: 10px;
    background: #ff4757;
    border-radius: 50%;
    animation: lcn-pulse 1.5s infinite;
}

@keyframes lcn-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.lcn-header-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* News Ticker */
#lcn-news-ticker {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.lcn-ticker-label {
    background: #fff;
    color: #c0392b;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    flex-shrink: 0;
    animation: lcn-flash 2s infinite;
}

@keyframes lcn-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.lcn-ticker-content {
    overflow: hidden;
    flex: 1;
}

.lcn-ticker-text {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    animation: lcn-scroll 20s linear infinite;
}

@keyframes lcn-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Messages Area */
#lcn-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #1a1a2e;
    position: relative;
}

#lcn-messages::-webkit-scrollbar {
    width: 6px;
}

#lcn-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#lcn-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Message Bubbles */
.lcn-message {
    display: flex;
    gap: 10px;
    animation: lcn-fadeIn 0.3s ease;
    position: relative;
}

/* Admin Delete Button */
.lcn-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    z-index: 10;
}

.lcn-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.lcn-message.user-message .lcn-delete-btn {
    left: 5px;
    right: auto;
}

/* Admin only - show delete on hover */
body.admin-bar .lcn-message:hover .lcn-delete-btn,
.lcn-admin .lcn-message:hover .lcn-delete-btn {
    opacity: 1;
}

/* ================================
   REACTIONS
   ================================ */
.lcn-reactions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    position: relative;
    z-index: 999;
    overflow: visible;
}

.lcn-message {
    overflow: visible;
}

/* Trigger wrapper */
.lcn-reaction-trigger-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lcn-reaction-trigger {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
    color: #fff;
    overflow: visible;
}

.lcn-reaction-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.lcn-reaction-trigger.lcn-user-reacted {
    background: rgba(102, 126, 234, 0.5);
    border-color: rgba(102, 126, 234, 0.7);
}

.lcn-reaction-trigger-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 10;
}

.lcn-reaction-options {
    display: flex;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #1e2a3a;
    border-radius: 20px;
    padding: 6px 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    flex-wrap: nowrap;
}

.lcn-message:hover .lcn-reaction-options,
.lcn-reaction-options.lcn-expanded {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 9999;
}

.lcn-reaction-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
    -webkit-text-fill-color: initial;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.lcn-reaction-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.2);
}

.lcn-reaction-btn.active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

.lcn-reaction-count {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
    cursor: default;
}

.lcn-reaction-count.lcn-active {
    background: rgba(102, 126, 234, 0.4);
}

.lcn-reaction-count-icon {
    font-size: 14px;
    -webkit-text-fill-color: initial;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.lcn-reaction-count-num {
    font-size: 11px;
    font-weight: 600;
}

/* Mobile: fixed elements and layout polish */
@media (max-width: 900px) {
    .lcn-reaction-options {
        top: 100%;
        left: 0;
        margin-top: 6px;
        z-index: 99;
    }
    
    .lcn-message:hover .lcn-reaction-options:not(.lcn-expanded) {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8);
    }
    
    .lcn-reaction-trigger {
        width: 48px;
        height: 48px;
    }
    
    .lcn-reaction-btn {
        width: 48px;
        height: 48px;
    }

    /* Sticky header pinned to very top with -100px margin to eliminate gap */
    #lcn-chat-header {
        position: sticky;
        top: 0;
        margin-top: -100px;
        flex-shrink: 0;
        padding: 10px 14px;
        z-index: 1000;
    }
    
    #lcn-breaking-banner.lcn-active {
        position: sticky;
        top: calc(44px + 10px);
        flex-shrink: 0;
        z-index: 1000;
    }
    
    #lcn-news-ticker {
        position: sticky;
        top: calc(44px + 0px);
        flex-shrink: 0;
        z-index: 1000;
    }

    @keyframes lcn-breaking-pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.8; }
    }

    #lcn-breaking-banner .lcn-dismiss-breaking {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255,255,255,0.3);
        border: none;
        color: #fff;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Messages scroll area */
    #lcn-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
        padding-bottom: 140px;
    }
    
    /* Pinned input area at bottom */
    #lcn-input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: #16213e;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
}

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

.lcn-message.user-message {
    flex-direction: row-reverse;
}

.lcn-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.lcn-message:not(.news-message) .lcn-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.lcn-message.news-message .lcn-avatar {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.lcn-message.system-message .lcn-avatar {
    background: transparent;
}

.lcn-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    background: #16213e;
    color: #fff;
}

.lcn-message.user-message .lcn-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom-right-radius: 4px;
}

.lcn-message.news-message .lcn-bubble {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    border-left: 3px solid #e74c3c;
    border-bottom-left-radius: 4px;
}

.lcn-message.system-message .lcn-bubble {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    max-width: 100%;
    font-size: 12px;
}

.lcn-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.lcn-username {
    font-weight: 600;
    font-size: 12px;
}

.lcn-message.news-message .lcn-username {
    color: #e74c3c;
}

.lcn-timestamp {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.lcn-bubble-text {
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.lcn-news-source {
    display: inline-block;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin-top: 6px;
}

/* Link Cards */
.lcn-link-card {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lcn-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lcn-link-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    background: #2d3436;
}

.lcn-link-card-content {
    padding: 10px;
}

.lcn-link-card-title {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lcn-link-card-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lcn-link-card-site {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    margin-top: 6px;
}

/* System Message */
.lcn-system-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.lcn-system-icon {
    font-size: 14px;
}

/* Input Area */
#lcn-input-area {
    padding: 12px;
    background: #16213e;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#lcn-username {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#lcn-username:focus {
    border-color: #667eea;
}

#lcn-username::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.lcn-input-row {
    display: flex;
    gap: 8px;
}

#lcn-message-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#lcn-message-input:focus {
    border-color: #667eea;
}

#lcn-message-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#lcn-send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#lcn-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#lcn-send-btn:active {
    transform: scale(0.95);
}

/* Link preview in input */
.lcn-link-preview {
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.lcn-link-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.lcn-link-preview-info {
    flex: 1;
}

.lcn-link-preview-title {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.lcn-link-preview-url {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

/* Loading indicator */
.lcn-loading {
    display: flex;
    gap: 4px;
    padding: 6px;
}

.lcn-loading-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: lcn-bounce 1.4s infinite ease-in-out both;
}

.lcn-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.lcn-loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes lcn-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ================================
   DESKTOP: Full viewport height, pinned input
   ================================ */
@media (min-width: 901px) {
    #lcn-stream-layout {
        height: 100dvh;
        overflow: hidden;
    }

    #lcn-chat-panel {
        height: 100dvh;
        display: flex !important;
        flex-direction: column;
    }

    #lcn-chat-container {
        height: 100% !important;
        border-radius: 0;
        box-shadow: none;
        display: flex !important;
        flex-direction: column;
    }

    /* Header and ticker stay at top, don't scroll */
    #lcn-chat-header {
        flex-shrink: 0;
    }

    #lcn-news-ticker {
        flex-shrink: 0;
    }

    #lcn-breaking-banner {
        flex-shrink: 0;
    }

    /* Messages fill remaining space and scroll */
    #lcn-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Input area pinned to bottom, doesn't scroll */
    #lcn-input-area {
        flex-shrink: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #lcn-stream-layout {
        min-height: auto;
    }
    
  
    
    .lcn-bubble {
        max-width: 85%;
    }
}

/* ================================
   CHAT OFFLINE STATE
   ================================ */

/* Dim red offline indicator */
.lcn-live-indicator.lcn-offline {
    background: #8b0000;
    animation: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Offline overlay - centered message */
.lcn-offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    padding: 20px;
}

.lcn-offline-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.lcn-offline-icon {
    font-size: 48px;
    opacity: 0.7;
    display: block;
    line-height: 1;
}

.lcn-offline-text {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

/* Offline ticker styling */
#lcn-news-ticker.lcn-ticker-offline {
    background: linear-gradient(90deg, #5a0000 0%, #3a0000 100%);
    opacity: 0.8;
}

.lcn-ticker-label.lcn-ticker-label-offline {
    background: #5a0000;
    color: #c0392b;
    animation: none;
    opacity: 0.8;
}

/* Status label */
.lcn-status-offline {
    color: rgba(255, 150, 150, 0.9);
}

/* Hide input area when offline */
#lcn-chat-container.lcn-chat-offline #lcn-input-area,
#lcn-chat-container.lcn-chat-offline .lcn-news-ticker {
    display: none !important;
}

