/* Global Styles */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Chat/Log Styling from Scaffolding */
.chat-msg {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-box {
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-msg-wrap {
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.chat-msg-wrap.msg-ai .bubble {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem 1rem 1rem 0;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-msg-wrap.msg-user {
    text-align: right;
}

.chat-msg-wrap.msg-user .bubble {
    background: #e7f1ff;
    color: #0d6efd;
    border: 1px solid #b6d4fe;
    border-radius: 1rem 1rem 0 1rem;
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .chat-msg-wrap.msg-user .bubble {
    background: #0d6efd;
    color: #fff;
    border-color: #0a58ca;
}

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

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

/* Video Container & Ad Overlay */
#video-container {
    overflow: hidden;
    border-radius: 0.5rem;
    background: #000;
}

/* Fullscreen adjustments */
#video-container:fullscreen {
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
}

#video-container:fullscreen video {
    height: 100%;
    width: 100%;
    object-fit: contain;
    /* Ensure video isn't cropped */
}

#video-container:fullscreen .ad-overlay {
    /* distinct positioning for fullscreen */
    position: fixed;
    bottom: 8vh;
    left: 4vw;
    width: 35vw;
    /* Responsive width */
    max-width: 600px;
    /* Cap width for huge screens */
    min-width: 400px;
    z-index: 9999;
    /* Ensure on top */

    /* Remove transforms that might blur images */
    transform: none;

    /* enhanced styling for big screen */
    background: rgba(10, 10, 10, 0.85);
    padding: 2rem;
    border-radius: 1rem;
}

/* Ensure image container works in fullscreen */
#video-container:fullscreen #ad-image-container {
    width: 100%;
    margin-bottom: 1.5rem !important;
}

/* Ensure text is readable on large screen */
#video-container:fullscreen h4 {
    font-size: 1.5rem;
}

#video-container:fullscreen p {
    font-size: 1.1rem;
}

.ad-overlay {
    position: absolute;
    bottom: 40px;
    left: 20px;

    /* Bigger width for image ads */
    width: 480px;
    max-width: 90%;

    /* Glassmorphism */
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    z-index: 10;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.ad-overlay.active {
    transform: translateY(0);
    opacity: 1;
}

/* Ad Content Typography */
#ad-title {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #ccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#ad-copy {
    font-weight: 300;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Log specific styles */
.log-timestamp {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--bs-secondary);
    margin-right: 0.5rem;
}

.highlight-match {
    background: rgba(25, 135, 84, 0.2);
    color: var(--bs-success);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
}