/* المسار: /wp-content/themes/astra-child/lounge/lounge.css */

/* --- 1. Main Container --- */
.lounge-wrapper {
    position: fixed; 
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1300px; height: 90vh;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 0 0 100vw rgba(0,0,0,0.7), 0 20px 50px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    z-index: 2147483647 !important;
    font-family: 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* --- 2. Header Bar --- */
.lounge-header-bar {
    background: #0f2a3a; height: 60px;
    border-bottom: 3px solid #C5AB88;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0;
}
.lounge-title-section { display: flex; align-items: center; gap: 15px; }
.lounge-text-wrap h3 { margin: 0; color: #fff; font-size: 18px; font-weight: 700; }
.lounge-text-wrap span { color: #C5AB88; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }

.lounge-action-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; font-size: 14px;
}
.lounge-action-btn:hover { background: #dc2626; color: #fff; transform: scale(1.1); }

/* --- 3. Workspace Layout --- */
.lounge-workspace { display: flex; flex: 1; overflow: hidden; height: 100%; }

/* --- 4. Sidebar --- */
.lounge-sidebar {
    width: 300px; background: #e2e8f0; border-right: 1px solid #cbd5e1;
    display: flex; flex-direction: column; overflow: hidden;
}
.lounge-sec-title {
    margin: 0; padding: 12px 15px; background: #cbd5e1; color: #0f2a3a;
    font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.lounge-list-container {
    flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px;
}

.lounge-item-card {
    background: #fff; padding: 12px; border-radius: 6px; cursor: pointer;
    border-left: 3px solid transparent; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; gap: 5px;
    outline: none !important;
}
.lounge-item-card:hover { transform: translateX(2px); border-left-color: #C5AB88; }
.lounge-item-card.active { background: #dbeafe; border-left-color: #2563eb; }

.lounge-card-top { display: flex; justify-content: space-between; align-items: center; }
.lounge-card-id-wrap { display: flex; align-items: center; gap: 8px; }
.lounge-qb-icon { height: 16px; width: auto; }
.lounge-card-id { font-weight: 800; color: #0f2a3a; font-size: 15px; }
.lounge-card-date { font-size: 10px; color: #94a3b8; letter-spacing: -0.2px; }
.lounge-card-bottom { font-size: 12px; color: #475569; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.lounge-subj-code { font-weight: 800; color: #0f2a3a; text-transform: uppercase; }
.lounge-sep { color: #cbd5e1; }
.lounge-topic-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* --- 5. Main Content --- */
.lounge-main-content { flex: 1; background: #fff; display: flex; flex-direction: column; position: relative; }

/* Question Area */
.lounge-question-box {
    padding: 20px 30px; background: #f8fafc; flex-shrink: 0;
    max-height: 45%; overflow-y: auto; border-bottom: 1px solid #cbd5e1;
    position: relative; z-index: 5;
}
.lounge-q-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.lounge-q-id-tag { font-size: 20px; font-weight: 800; color: #0f2a3a; display: flex; align-items: center; gap: 10px; }
.lounge-header-icon-img { height: 32px; width: auto; margin-right: 10px; vertical-align: middle; }
.lounge-q-meta { font-size: 13px; color: #64748b; font-weight: 600; margin-left: 10px; }

.lounge-q-text { 
    font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 20px; line-height: 1.6; 
}

/* 🔥🔥 Question Images Thumbnails 🔥🔥 */
.lounge-q-images-container {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; padding-top: 10px; border-top: 1px dashed #cbd5e1;
}
.lounge-q-thumb-wrap {
    width: 80px; height: 80px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid #e2e8f0; transition: all 0.2s ease; background: #fff; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.lounge-q-thumb-wrap:hover {
    border-color: #C5AB88; transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.lounge-q-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.lounge-q-thumb-wrap::after {
    content: '\f00e'; font-family: "Font Awesome 5 Free"; font-weight: 900;
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); color: #fff; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.2s; font-size: 16px;
}
.lounge-q-thumb-wrap:hover::after { opacity: 1; }

/* Choices Styles */
.lounge-choices-box { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.lounge-choice-row {
    padding: 10px 15px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 14px; color: #334155; display: flex; align-items: flex-start; gap: 10px; transition: all 0.2s ease;
}
.lounge-choice-row.correct { 
    background: #dcfce7 !important; border-color: #22c55e !important; color: #14532d !important; font-weight: 700;
}
.lounge-choice-row .opt-icon { font-size: 16px; margin-top: 2px; }
.lounge-choice-row.correct .opt-icon { color: #16a34a; }

/* Chat Area */
.lounge-chat-area { flex: 1; display: flex; flex-direction: column; background: #fff; overflow: hidden; position: relative; }
.lounge-stream-container { flex: 1; padding: 25px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; background: transparent !important; }
.lounge-comment-thread-wrapper { display: flex; flex-direction: column; position: relative; z-index: 1; }
.lounge-no-expl {
    text-align: center; background: rgba(241, 245, 249, 0.9); border: 1px dashed #94a3b8;
    padding: 12px; border-radius: 8px; color: #64748b; font-size: 12px; font-weight: 600; margin-bottom: 15px;
}

/* Messages Tree */
.lounge-conversation-tree {
    position: relative; margin-left: 55px; display: flex; flex-direction: column; gap: 15px; padding-left: 20px; margin-top: -5px; padding-top: 15px;
}
.lounge-reply-branch { position: relative; }
.lounge-reply-branch::after {
    content: ''; position: absolute; left: -22px; top: 0; bottom: 0; width: 2px; background: #cbd5e1;
}
.lounge-reply-branch:last-child::after { display: none; }
.lounge-reply-branch::before {
    content: ''; position: absolute; left: -22px; top: 0; width: 25px; height: 25px;
    border-bottom: 2px solid #cbd5e1; border-left: 2px solid #cbd5e1; border-bottom-left-radius: 12px;
}

/* Clean Row (No Border) */
.lounge-msg-row { 
    display: flex; gap: 10px; max-width: 90%; align-self: flex-start; position: relative; z-index: 2;
    border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important;
}
.lounge-msg-row.msg-admin { align-self: center; width: 100%; max-width: 98%; margin-bottom: 10px; }

/* Avatar */
.lounge-avatar {
    width: 38px; height: 38px; border-radius: 50% !important; background: #0f2a3a;
    border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); flex-shrink: 0; overflow: hidden; 
}
.lounge-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Bubble Only */
.msg-bubble { 
    padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); border: none !important; position: relative;
}
.msg-user .msg-bubble { background-color: #e0f2fe; color: #0f172a; } 
.msg-me .msg-bubble { background-color: #dcfce7; color: #14532d; } 
.msg-admin .msg-bubble { background-color: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444 !important; }

.msg-header-col { display: flex; flex-direction: column; margin-bottom: 6px; line-height: 1.2; }
.msg-author { font-weight: 800; color: #0f2a3a; font-size: 12px; }
.msg-date-sub { font-size: 10px; color: #94a3b8; font-weight: 400; margin-top: 1px; }
.lounge-reply-action { font-size: 11px; color: #64748b; margin-top: 5px; cursor: pointer; font-weight: 600; display: inline-block; transition: 0.2s; }
.lounge-reply-action:hover { color: #0f2a3a; text-decoration: underline; }

/* Input Area */
#lounge-reply-indicator {
    background: #e2e8f0; padding: 6px 20px; font-size: 12px; color: #334155;
    border-top: 1px solid #cbd5e1; display: flex; justify-content: space-between; align-items: center;
}
.lounge-reply-area {
    padding: 12px 20px; border-top: 1px solid #e2e8f0; background: #fff; display: flex; align-items: center; gap: 12px; position: relative; z-index: 10;
}
#lounge-reply-input {
    flex: 1; height: 42px; border-radius: 21px; border: 1px solid #cbd5e1; padding: 0 18px; outline: none; font-size: 14px; transition: 0.2s;
}
#lounge-reply-input:focus { border-color: #C5AB88; background: #fff; box-shadow: 0 0 0 3px rgba(197, 171, 136, 0.1); }
.lounge-send-btn {
    width: auto !important; height: auto !important; border-radius: 0 !important;
    background: transparent !important; color: #0f2a3a; border: none !important; 
    cursor: pointer; display: flex; align-items: center; justify-content: center; 
    font-size: 22px; padding: 0 10px; box-shadow: none !important;
}
.lounge-send-btn:hover { color: #C5AB88; transform: scale(1.1); }

/* eBook Modal */
@keyframes eBookPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(197, 171, 136, 0)); opacity: 1; }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(197, 171, 136, 0.9)); opacity: 0.8; }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(197, 171, 136, 0)); opacity: 1; }
}
.lounge-header-ebook-btn { cursor: pointer; animation: eBookPulse 2s infinite ease-in-out; margin-right: 12px !important; }
.lounge-header-ebook-btn:hover { animation: none; transform: scale(1.1); filter: drop-shadow(0 0 5px #C5AB88); }

.lounge-modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(4px);
    z-index: 99999999 !important; display: flex; justify-content: center; align-items: center;
    border-radius: 12px; 
}
.lounge-ebook-popup {
    width: 85%; max-width: 800px; height: 90%;
    background-color: #fcfbf7;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, #e3dacd 2px, #e3dacd 3px);
    background-size: 100% 4px; border-radius: 6px; border: 6px double #d4c5b0;
    outline: 1px solid #f0e6d2; 
    box-shadow: inset 0 0 80px rgba(160, 140, 110, 0.35), 0 20px 60px rgba(0,0,0,0.6), 0 0 0 5px rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; overflow: hidden;
}
.lounge-ebook-header {
    height: 50px; background: #0f2a3a; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0; border-bottom: 3px solid #C5AB88;
}
.lounge-ebook-header h4 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
#lounge-ebook-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; transition: 0.2s; opacity: 0.8; }
#lounge-ebook-close:hover { color: #C5AB88; transform: scale(1.1); opacity: 1; }
.lounge-ebook-body {
    flex: 1; overflow-y: auto; padding: 50px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 17px; line-height: 1.8; color: #2c3e50;
}
.eb-book-slider h1 { font-size: 26px; border-bottom: 2px solid #e2d9cc; padding-bottom: 15px; margin-bottom: 25px; color: #0f2a3a; font-family: 'Segoe UI', sans-serif; font-weight: 800; }
.eb-book-slider h2 { font-size: 21px; margin-top: 35px; color: #0f2a3a; border-left: 4px solid #C5AB88; padding-left: 10px; }
.eb-book-slider p { margin-bottom: 18px; text-align: justify; }
.eb-book-slider img { max-width: 100%; height: auto; display: block; margin: 30px auto; border: 5px solid #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* 🔥🔥 Image Preview Modal (Fixed Inside Lounge with Stylish Button) 🔥🔥 */
.lounge-img-overlay {
    position: absolute; /* يضمن ظهورها داخل اللاونج */
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); /* خلفية داكنة */
    z-index: 99999; /* ترتيب مرتفع فوق المحتوى */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    border-radius: 12px;
}

.lounge-img-box {
    position: relative;
    width: 50%; /* ✅ العرض 50% من النافذة */
    max-width: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.lounge-img-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border: 4px solid #fff;
    max-height: 85vh; /* عشان لو الصورة طويلة متخرجش */
    object-fit: contain;
}

/* ✅ زر إغلاق شيك */
#lounge-img-close {
    position: absolute;
    top: -18px;
    right: -18px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    background: #ef4444; /* لون أحمر */
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* تأثير مطاطي */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

#lounge-img-close:hover {
    background: #dc2626;
    transform: scale(1.15) rotate(90deg); /* تكبير ودوران عند الوقوف عليه */
}

/* Overlap Fixes */
.elementor-element-636c289 { pointer-events: none !important; z-index: 0 !important; }
#menu-item-5935, .lounge-trigger { position: relative !important; z-index: 2147483647 !important; pointer-events: auto !important; }