/**
 * ANAM Video Avatar Styles for SimChat
 */

/* Video container styling */
.video-container {
    position: relative;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1a1a2e;
    /* Maintain 3:2 aspect ratio per ANAM best practices */
    aspect-ratio: 3 / 2;
    width: 100%;
    max-width: 900px; /* ANAM optimal desktop width */
    margin: 0 auto;
}

#anam-video {
    position: relative;
    z-index: 1;
    background: transparent;
    /* Use contain to prevent cropping top/bottom of avatar */
    object-fit: contain;
    width: 100%;
    height: 100%;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
}

.loading-overlay.d-none {
    display: none !important;
}

/* Control button styling */
.control-button {
    min-width: 200px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.control-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Error message styling */
#connection-error-message {
    max-width: 500px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-container {
        /* Mobile: 100% width with 400px minimum height per ANAM best practices */
        max-width: 100%;
        min-height: 400px;
    }
}

/* Status message positioning */
.status-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    min-width: 300px;
    max-width: 600px;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    font-weight: 500;
}

.status-message.d-none {
    display: none !important;
}

/* Fullscreen toggle button (overlays the video, top-right) */
.video-fullscreen-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.55);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}

.video-fullscreen-toggle:hover,
.video-fullscreen-toggle:focus-visible {
    background: rgba(26, 26, 46, 0.85);
    opacity: 1;
    outline: none;
}

.video-fullscreen-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
}

/* Fullscreen / expanded state: fills the viewport while keeping controls usable.
   Applied via the Fullscreen API (:fullscreen) and as a CSS fallback class. */
.video-container:fullscreen,
.video-container.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    margin: 0;
    background-color: #000;
}

.video-container.is-fullscreen {
    /* CSS fallback when the Fullscreen API is unavailable. */
    position: fixed;
    inset: 0;
    z-index: 1080;
}

.video-container:fullscreen #anam-video,
.video-container.is-fullscreen #anam-video {
    width: 100%;
    height: 100%;
}

.video-container:fullscreen .video-fullscreen-toggle,
.video-container.is-fullscreen .video-fullscreen-toggle {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

