/* Core Container */
.boxbox-live-container {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    color: #ffffff;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
}

/* Header & Status */
.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #e10600;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-style: italic;
    box-shadow: 0 0 20px rgba(225, 6, 0, 0.3);
}

.status-finished .live-status {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

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

@keyframes live-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Frontend Editor DARK FIX */
#boxbox-frontend-editor {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 4rem;
}

#boxbox-frontend-editor h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #e10600;
    text-transform: uppercase;
    font-style: italic;
}

.wp-editor-wrap {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 0.75rem !important;
}

/* Force standard dark colors for editor box */
.wp-editor-area {
    background: #1a1a1a !important;
    color: #fff !important;
    padding: 1.5rem !important;
    font-size: 1rem !important;
}

/* Feed & Timeline */
.live-items-list {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 5px;
}

.live-items-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e10600 0%, rgba(225, 6, 0, 0.05) 100%);
}

.live-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    animation: itemIn 0.5s ease-out;
}

/* Tinted States - Applied to Body Bubble */
.live-item.type-yellow .live-item-body,
.live-item.type-text_yellow .live-item-body {
    background-color: rgba(255, 235, 59, 0.07) !important;
    border-color: rgba(255, 235, 59, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' opacity='0.03'%3E%3Crect width='10' height='10' fill='%23ffeb3b'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23ffeb3b'/%3E%3C/svg%3E");
}

.live-item.type-red .live-item-body,
.live-item.type-text_red .live-item-body {
    background-color: rgba(244, 67, 54, 0.08) !important;
    border-color: rgba(244, 67, 54, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' opacity='0.03'%3E%3Crect width='10' height='10' fill='%23f44336'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23f44336'/%3E%3C/svg%3E");
}

.live-item.type-sc .live-item-body,
.live-item.type-vsc .live-item-body,
.live-item.type-text_sc .live-item-body,
.live-item.type-text_vsc .live-item-body {
    background-color: rgba(255, 152, 0, 0.08) !important;
    border-color: rgba(255, 152, 0, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' opacity='0.03'%3E%3Crect width='10' height='10' fill='%23ff9800'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23ff9800'/%3E%3C/svg%3E");
}

/* Left Indicator Bar on Bubble */
.live-item[class*="type-"] .live-item-body {
    border-left-width: 4px;
}

.live-item.type-green .live-item-body {
    border-left-color: #4caf50;
    background-color: rgba(76, 175, 80, 0.07) !important;
    border-color: rgba(76, 175, 80, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' opacity='0.03'%3E%3Crect width='10' height='10' fill='%234caf50'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%234caf50'/%3E%3C/svg%3E");
}

.live-item.type-yellow .live-item-body {
    border-left-color: #ffeb3b;
}

.live-item.type-red .live-item-body {
    border-left-color: #f44336;
}

.live-item.type-sc .live-item-body,
.live-item.type-vsc .live-item-body {
    border-left-color: #ff9800;
}

@keyframes itemIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-item-time {
    flex: 0 0 4rem;
    color: #e10600;
    font-weight: 900;
    font-size: 0.9rem;
    padding-left: 1.25rem;
    position: relative;
    font-family: ui-monospace, monospace;
}

.time-dot {
    position: absolute;
    left: -11px;
    top: 0.3rem;
    width: 14px;
    height: 14px;
    background: #e10600;
    border: 3px solid #0a0a0a;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

.live-item-body {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.5rem;
    padding: 1.25rem;
    position: relative;
    /* Removed overflow:hidden to prevent cropping of social embeds */
}

/* Tight Spacing Reset */
.live-item-content>* {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.45 !important;
}

.live-item-content>*:last-child {
    margin-bottom: 0 !important;
}

.live-item-content p {
    line-height: 1.45 !important;
}

.social-embed-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem !important;
}

.delete-update-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    font-size: 1.2rem;
}

.delete-update-btn:hover {
    color: #e10600;
    transform: scale(1.1);
}

.live-item-content {
    font-size: 1.1rem;
    color: #eee;
    line-height: 1.25 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive Embeds Fixes */
.live-item-content iframe,
.live-item-content .twitter-tweet,
.live-item-content .instagram-media,
.live-item-content video {
    max-width: 550px !important;
    /* Unified width based on Twitter */
    width: 100% !important;
    margin: 0 auto !important;
    display: block !important;
}

.twitter-tweet {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* YouTube Specific Ratio */
.live-item-content iframe[src*="youtube.com"],
.live-item-content iframe[src*="youtu.be"] {
    aspect-ratio: 16 / 9;
    height: auto !important;
}

/* Social Specific Tweaks */
.twitter-tweet {
    visibility: visible !important;
}

.instagram-media {
    background: #000 !important;
    min-width: 280px !important;
    /* Allow more shrinking on mobile */
}

.twitter-tweet iframe,
.instagram-media iframe {
    width: 100% !important;
    max-width: 100% !important;
}

.live-item img,
.live-item-media img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    cursor: zoom-in;
}

/* Overlay for Zoom */
#boxbox-live-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    cursor: zoom-out;
}

.expanded-img-clone {
    max-width: 96vw;
    max-height: 96vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Actions Buttons */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.flag-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flag-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.flag-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.flag-btn.green:hover {
    border-color: #4caf50;
    color: #4caf50;
}

.flag-btn.yellow:hover {
    border-color: #ffeb3b;
    color: #ffeb3b;
}

.flag-btn.red:hover {
    border-color: #f44336;
    color: #f44336;
}

.flag-btn.sc:hover,
.flag-btn.vsc:hover {
    border-color: #ff9800;
    color: #ff9800;
}

.main-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.boxbox-live-container .button-primary {
    background: #e10600 !important;
    color: #fff !important;
    border: none !important;
    padding: 0.8rem 2rem !important;
    border-radius: 0.5rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    cursor: pointer;
}

.boxbox-live-container .button-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 0.5rem !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.media-modal .button-primary.media-button {
    background-color: #2271b1 !important;
    color: #fff !important;
    border: 1px solid #2271b1 !important;
    text-shadow: none !important;
}

@media (max-width: 768px) {
    .boxbox-live-container {
        padding: 0.5rem 0.1rem !important;
        margin: 1rem 0 !important;
    }

    .live-items-list {
        padding-left: 0 !important;
    }

    .live-items-list::before {
        left: 5px !important;
        opacity: 0.3;
    }

    .live-item {
        flex-direction: column !important;
        gap: 0.2rem !important;
        padding-left: 15px !important;
        margin-bottom: 1.25rem !important;
        align-items: flex-start !important;
    }

    .live-item-time {
        flex: none !important;
        width: 100% !important;
        padding-left: 0 !important;
        margin-bottom: 2px !important;
        font-size: 0.75rem !important;
        line-height: 1 !important;
        color: rgba(225, 6, 0, 0.8) !important;
    }

    .time-dot {
        left: -16px !important;
        top: 0.2rem !important;
    }

    .live-item-body {
        padding: 0.4rem !important;
        border-radius: 0.4rem !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .live-item-content {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    .live-item-content>* {
        margin-bottom: 0.35rem !important;
    }

    .live-item-content .twitter-tweet,
    .live-item-content .instagram-media,
    .live-item-content iframe,
    .social-embed-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .button-secondary,
    .boxbox-live-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }
}