html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #111;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /*align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;*/
    
}
body {
    height: 100dvh;
}
h1 {
    margin: 12px 0 6px;
    text-align: center;
    flex: 0 0 auto;
}

/* Main container */
#video-wrapper {
    flex: 1;
    display: flex;
    min-height: 0;
    /*flex-direction: column;*/
    overflow: hidden;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Video + overlay container */
#video-container {
    position: relative;
    /*display: inline-block;*/
    height: 100%;
    width: 100%;
    flex: 1;
    align-items: center;
    justify-content: center;
    /*max-width: 1000px;*/
    /*border-radius: 10px;*/
    overflow: hidden;
}

/* Video styling */
#timelapse {
    display: block;
    object-fit: contain;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    /*height: auto;
    border-radius: 10px;*/
    transition: opacity 0.5s ease;
}

/* AI Overlay */
#ai-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    pointer-events: none; /* allow video controls */
}

/* Container for markers */
#ai-comments-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual comment */
.ai-comment {
    position: absolute;
    top: -10px;
    left: 12px;

    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.3;
    max-width: 200px;

    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap;

    animation: fadeIn 0.5s ease;
}

/* Marker container */
.ai-marker {
    position: absolute;
    transform: translate(-50%, -50%);
}

/* Green dot */
.ai-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0 0 6px #00ff88;
    display: none;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toggle button */
#toggle-ai {
    margin-bottom: 10px;
    flex: 0 0 auto;
    /*padding: 8px 14px;*/
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
}

#toggle-ai:hover {
    background: #333;
}

/* Hidden state */
#ai-overlay.hidden {
    display: none;
}

#video-wrapper,
#video-container {
    min-height: 0;
    min-width: 0;
}
