/* --- 1. BODY LOCK (Prevent scrolling of the main site) --- */
html.papisek-fullscreen-mode,
body.papisek-fullscreen-mode {
    overflow: hidden !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 2. THE APP CONTAINER (Breakout) --- */
#papisek-app-root {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important; /* Max integer value */
    background: #000;
    display: flex;
    flex-direction: column;
}

/* Hide WP Theme Elements */
.papisek-fullscreen-mode #radio-player-bar,
.papisek-fullscreen-mode #mwai-chat-widget,
.papisek-fullscreen-mode header,
.papisek-fullscreen-mode footer,
.papisek-fullscreen-mode #wpadminbar {
    display: none !important;
}

/* --- 3. LAYOUT --- */
.papisek-room-grid {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* --- 4. VIDEO AREA --- */
#papisek-video-area {
    flex: 1;
    position: relative;
    height: 100%;
    background: #000;
}
#jitsi-meet-conf-container {
    width: 100%;
    height: 100%;
}
#jitsi-meet-conf-container iframe {
    /* Scale fix for hiding watermark */
    width: 100%; 
    height: 100%; 
    border: none;
}

/* --- 5. SIDEBAR (Default: HIDDEN) --- */
#papisek-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px; /* Optimal width */
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    
    /* Animation Logic */
    transform: translateX(100%); /* Start Off-Screen (Right) */
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* State: Open */
#papisek-sidebar.open {
    transform: translateX(0); /* Slide In */
}

/* Sidebar Components */
.sidebar-header {
    height: 60px;
    background: #f0f2f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 16px;
    font-weight: bold;
}
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #fff;
}
.sidebar-tab {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: 0.2s;
}
.sidebar-tab.active {
    border-bottom: 3px solid #007bff;
    color: #007bff;
    font-weight: 600;
}
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* --- 6. TOGGLE BUTTON --- */
.papisek-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.papisek-toggle-btn:hover {
    transform: scale(1.1);
    background: #fff;
}
.papisek-toggle-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #333;
}

/* --- 7. LOBBY --- */
.papisek-lobby {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #fff;
}
.papisek-lobby-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    width: 350px;
}
/* wp-content/plugins/papisek-prayer-room/assets/style.css */

.papisek-lobby-input {
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.5) !important; /* Brighter border */
    background: rgba(0, 0, 0, 0.5) !important; /* Darker background for contrast */
    color: #ffffff !important; /* FORCE WHITE TEXT */
    font-size: 16px;
    text-align: center;
    outline: none;
}

.papisek-lobby-input::placeholder {
    color: #cccccc !important; /* Light grey placeholder */
}
.papisek-btn-primary {
    width: 100%;
    padding: 12px;
    background: #00b09b; /* Modern gradient button */
    background: linear-gradient(to right, #00b09b, #96c93d);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.papisek-btn-primary:hover { opacity: 0.9; }

/* --- 8. AI CHATBOT INTEGRATION (STRICT CONTAINMENT & SCROLL FIX) --- */

#tab-ai {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden; 
    position: relative; /* Zabrání úniku prvků mimo záložku */
}

#tab-ai.active {
    display: flex;
}

/* 1. AGRESIVNÍ ZKROCENÍ: Zrušíme plovoucí pozici a donutíme flexbox fungovat */
#papisek-ai-container,
#papisek-ai-container .mwai-chatbot,
#papisek-ai-container .mwai-chat,
#papisek-ai-container .mwai-window {
    position: relative !important; /* KRITICKÉ: Zabrání překrytí záložek */
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;      /* KRITICKÉ: Povolí scrollování potomků */
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    z-index: 1 !important;
}

/* 2. OBLAST SE ZPRÁVAMI: Zapnutí vertikálního rolování */
#papisek-ai-container .mwai-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important; 
    min-height: 0 !important;
    height: auto !important;
    padding: 15px !important;
}

/* 3. OBLAST PRO PSANÍ: Ukotvení pevně dole */
#papisek-ai-container .mwai-input {
    flex: 0 0 auto !important;
    margin-top: auto !important;
}

/* 4. Skrytí jakýchkoliv globálních bublin, které se snaží vložit šablona */
.papisek-fullscreen-mode .mwai-window-button,
.papisek-fullscreen-mode .mwai-overlay {
    display: none !important; 
}

/* --- 9. BIBLE PROJECTION (LIVE OVERLAY) --- */

.papisek-selectable-verse {
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    border-radius: 4px;
    border: 1px solid transparent;
}

.papisek-selectable-verse:hover {
    background-color: #f0f8ff;
    border-color: #b8daff;
}

.papisek-selectable-verse.selected {
    background-color: #d1ecf1 !important;
    border-color: #bee5eb !important;
    color: #0c5460;
}

#bible-selection-bar {
    display: none; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: #2c3338; 
    color: #fff; 
    padding: 10px 15px; 
    box-sizing: border-box; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 20; 
    border-top: 2px solid #0073aa;
}