/* ==========================================================================
   MeetNow WebRTC Video Calling Application Styling (Bootstrap 5 System)
   ========================================================================== */

:root {
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg-dark-stage: #000000;
    --bg-dark-header: #0f172a;
    --bg-dark-sidebar: #0f172a;
    --bg-dark-card: #1e293b;
}

/* 1. Global Reset - Allows smooth vertical scrolling on /vcall landing page */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

/* Scoped body lock only when inside active video room */
body.in-video-room {
    overflow: hidden !important;
    height: 100vh !important;
}

.fw-extrabold { font-weight: 800; }
.fw-mono { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.backdrop-blur {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Fixed Header (70px Height) */
.room-header-bar {
    height: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    z-index: 1040 !important;
}

.room-brand-logo .logo-img,
.navbar-brand img.logo-image,
.logo-img {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: 180px !important;
    object-fit: contain !important;
    display: block !important;
}

.btn-header-ctrl {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    border: none !important;
    transition: transform 0.2s ease !important;
}

.btn-header-ctrl:hover {
    transform: scale(1.08) !important;
}

/* Left Video Stage Area (Respects Bootstrap Grid Column: 75% on XL, 66.7% on LG/MD) */
#videoStageCol.video-stage-area {
    background: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.remote-video-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000 !important;
    box-shadow: none !important;
}

#remoteVideo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Covers stage area seamlessly */
    background: #000000 !important;
}

/* Self Camera Picture-in-Picture Thumbnail (Bottom-Right of Video Stage, 220x140px) */
#localVideoWrapper.local-video-pip {
    bottom: 20px !important;
    right: 20px !important;
    width: 220px !important;
    height: 140px !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
    overflow: hidden !important;
    z-index: 1030 !important;
    background: #000000 !important;
}

#effectsCanvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scaleX(-1) !important; /* Natural self-view camera mirror */
    z-index: 5 !important;
}

#localVideo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scaleX(-1) !important; /* Natural self-view camera mirror */
    z-index: 1 !important;
}

/* Right Permanent Chat Sidebar Column (25% on XL, 33.3% on LG/MD) */
#chatSidebar.room-sidebar {
    background: #0f172a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    z-index: 1030 !important;
    overflow: hidden !important;
}

.sidebar-tab-btn.active {
    color: #6366f1 !important;
    border-bottom: 2px solid #6366f1 !important;
    background: rgba(99, 102, 241, 0.1) !important;
}

.chat-messages-container,
.participants-container {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 170px) !important;
    padding: 16px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
}

.chat-messages-container::-webkit-scrollbar,
.participants-container::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-container::-webkit-scrollbar-thumb,
.participants-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Animations & Utility Helpers */
.animate-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

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

.max-w-md { max-width: 440px; }
.fs-7 { font-size: 0.875rem; }
.fs-8 { font-size: 0.75rem; }

/* Responsive Mobile Override */
@media (max-width: 768px) {
    #chatSidebar.room-sidebar {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        z-index: 1050 !important;
    }

    #localVideoWrapper.local-video-pip {
        width: 140px !important;
        height: 90px !important;
        bottom: 12px !important;
        right: 12px !important;
    }

    .btn-header-ctrl {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 0.9rem !important;
    }
}
