/* ==========================================================================
   elTutors — Behance-Inspired Corporate Design System
   Bootstrap 5.3 Extension with Dual RTL/LTR Support
   Border Radius: 12px - 14px | Behance Blue: #0057FF | Slate: #0F172A
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bh-primary: #0057FF;
    --bh-primary-hover: #0045D8;
    --bh-primary-light: #EBF2FF;
    --bh-dark: #0F172A;
    --bh-slate: #1E293B;
    --bh-gray-light: #F8F9FA;
    --bh-gray-canvas: #F4F5F7;
    --bh-border: #E2E8F0;
    --bh-border-focus: #94A3B8;
    --bh-text-muted: #64748B;
    --bh-success: #10B981;
    --bh-warning: #F59E0B;
    --bh-danger: #EF4444;
    
    /* Strict 10px - 15px radius specification */
    --bh-radius-sm: 10px;
    --bh-radius: 12px;
    --bh-radius-lg: 14px;
    --bh-radius-pill: 9999px;

    --bh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --bh-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --bh-shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}

/* Typography & Base */
html {
    height: 100%;
    min-height: 100%;
}

body {
    background-color: var(--bh-gray-canvas);
    color: var(--bh-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    min-height: 100vh !important;
    display: flex;
    display: flex !important;
    flex-direction: column;
    flex-direction: column !important;
    margin: 0;
    padding: 0;
    position: relative;
}

main {
    flex: 1 0 auto;
    flex: 1 0 auto !important;
    flex-grow: 1 !important;
    width: 100%;
}

footer {
    margin-top: auto !important;
    flex-shrink: 0 !important;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* In-Platform Direct Messaging & Coordination Hub */
.bh-chat-wrapper {
    height: calc(100vh - 210px);
    min-height: 520px;
    background: #FFFFFF;
    border-radius: var(--bh-radius-lg);
    border: 1px solid var(--bh-border);
    box-shadow: var(--bh-shadow);
    overflow: hidden;
}

.bh-chat-sidebar {
    border-left: 1px solid var(--bh-border);
    overflow-y: auto;
    background: #FAFBFD;
}
[dir="ltr"] .bh-chat-sidebar {
    border-left: none;
    border-right: 1px solid var(--bh-border);
}

.bh-chat-contact-item {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--bh-border);
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}
.bh-chat-contact-item:hover,
.bh-chat-contact-item.active {
    background-color: #F1F5F9;
}
.bh-chat-contact-item.active {
    border-right: 3px solid var(--bh-primary);
}
[dir="ltr"] .bh-chat-contact-item.active {
    border-right: none;
    border-left: 3px solid var(--bh-primary);
}

.bh-chat-thread-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #FFFFFF;
}

.bh-chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #F8FAFC;
}

.bh-bubble {
    max-width: 75%;
    padding: 0.85rem 1.15rem;
    border-radius: 14px;
    position: relative;
    word-break: break-word;
    font-size: 0.93rem;
}

.bh-bubble-sent {
    background-color: var(--bh-primary);
    color: #FFFFFF;
    border-bottom-left-radius: 4px;
    margin-left: auto;
}
[dir="rtl"] .bh-bubble-sent {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
    margin-left: 0;
    margin-right: auto;
}

.bh-bubble-received {
    background-color: #FFFFFF;
    color: #1E293B;
    border: 1px solid var(--bh-border);
    border-bottom-right-radius: 4px;
    margin-right: auto;
}
[dir="rtl"] .bh-bubble-received {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 4px;
    margin-right: 0;
    margin-left: auto;
}

.bh-quick-preset-btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--bh-radius-pill);
    background-color: #EBF2FF;
    color: var(--bh-primary);
    border: 1px solid #BFDBFE;
    cursor: pointer;
    transition: all 0.15s ease;
}
.bh-quick-preset-btn:hover {
    background-color: var(--bh-primary);
    color: #FFFFFF;
}

/* Full-Page Executive Mega Navigation Drawer (Behance / Stripe Enterprise Style) */
.bh-offcanvas-sidebar {
    width: min(92vw, 1380px) !important;
    max-width: 95vw !important;
    background-color: #F8FAFC !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.28) !important;
    border: none !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (max-width: 991.98px) {
    .bh-offcanvas-sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Explicit Bidirectional Opening Rules:
   Arabic (RTL): Opens from RIGHT
   English (LTR): Opens from LEFT */
[dir="rtl"] .offcanvas-start.bh-offcanvas-sidebar {
    right: 0 !important;
    left: auto !important;
    border-right: none !important;
    border-left: 1px solid #E2E8F0 !important;
    transform: translateX(100%) !important;
}
[dir="rtl"] .offcanvas-start.bh-offcanvas-sidebar.show {
    transform: none !important;
}

[dir="ltr"] .offcanvas-start.bh-offcanvas-sidebar,
body:not([dir="rtl"]) .offcanvas-start.bh-offcanvas-sidebar {
    left: 0 !important;
    right: auto !important;
    border-left: none !important;
    border-right: 1px solid #E2E8F0 !important;
    transform: translateX(-100%) !important;
}
[dir="ltr"] .offcanvas-start.bh-offcanvas-sidebar.show,
body:not([dir="rtl"]) .offcanvas-start.bh-offcanvas-sidebar.show {
    transform: none !important;
}

/* Backdrop enhancement */
.offcanvas-backdrop.show {
    opacity: 0.65 !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* Mega Menu Card Grid & Clear Navigation Sections */
.bh-mega-card {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.15rem 1.25rem !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.bh-mega-card:hover {
    border-color: #CBD5E1 !important;
    box-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(-2px) !important;
}

.bh-mega-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 1px solid #F1F5F9 !important;
}

.bh-mega-card-title {
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    margin: 0 !important;
    color: #0F172A !important;
}

.bh-mega-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.6rem 0.75rem !important;
    color: #334155 !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    transition: all 0.16s ease !important;
    margin-bottom: 0.25rem !important;
}

.bh-mega-link:hover {
    background-color: #F8FAFC !important;
    color: #0057FF !important;
}

[dir="rtl"] .bh-mega-link:hover {
    padding-right: 0.95rem !important;
}

[dir="ltr"] .bh-mega-link:hover,
body:not([dir="rtl"]) .bh-mega-link:hover {
    padding-left: 0.95rem !important;
}

.bh-mega-link.active {
    background-color: #EFF6FF !important;
    color: #0057FF !important;
    font-weight: 700 !important;
}

[dir="rtl"] .bh-mega-link.active {
    border-right: 3px solid #0057FF !important;
}

[dir="ltr"] .bh-mega-link.active,
body:not([dir="rtl"]) .bh-mega-link.active {
    border-left: 3px solid #0057FF !important;
}

.bh-mega-link i.link-icon {
    font-size: 1rem !important;
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    flex-shrink: 0 !important;
    transition: all 0.16s ease !important;
}

.bh-mega-link:hover i.link-icon {
    background-color: #0057FF !important;
    color: #FFFFFF !important;
}

.bh-mega-link.active i.link-icon {
    background-color: #0057FF !important;
    color: #FFFFFF !important;
}

/* Mega Search Input */
.bh-mega-search-wrapper {
    position: relative !important;
}

.bh-mega-search-input {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.92rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
}

.bh-mega-search-input:focus {
    border-color: #0057FF !important;
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12) !important;
    outline: none !important;
}

.bh-sidebar-heading {
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-weight: 700 !important;
    color: #64748B !important;
    padding: 0.85rem 0.5rem 0.35rem !important;
}

/* Black Sticky Footer with White Text, Icons, and Links */
.bh-footer-dark {
    background-color: #0A0E1A !important;
    color: #FFFFFF !important;
    border-top: 1px solid #1E293B !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
    position: relative !important;
    bottom: 0 !important;
    width: 100% !important;
}

.bh-footer-dark p,
.bh-footer-dark span,
.bh-footer-dark small,
.bh-footer-dark strong {
    color: #FFFFFF !important;
}

.bh-footer-dark a {
    color: #FFFFFF !important;
    text-decoration: none !important;
    transition: opacity 0.18s ease !important;
}

.bh-footer-dark a:hover {
    color: #FFFFFF !important;
    opacity: 0.8 !important;
    text-decoration: underline !important;
}

.bh-footer-dark i {
    color: #FFFFFF !important;
}

[dir="rtl"] body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

/* Card Elements (Behance style) */
.card, .bh-card {
    background-color: #FFFFFF;
    border: 1px solid var(--bh-border);
    border-radius: var(--bh-radius);
    box-shadow: var(--bh-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover, .bh-card-hover:hover {
    box-shadow: var(--bh-shadow-hover);
    border-color: #CBD5E1;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--bh-border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--bh-gray-light);
    border-top: 1px solid var(--bh-border);
    border-bottom-left-radius: var(--bh-radius) !important;
    border-bottom-right-radius: var(--bh-radius) !important;
    padding: 1rem 1.5rem;
}

/* Primary Corporate Buttons */
.btn {
    border-radius: var(--bh-radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary, .btn-bh-primary {
    background-color: var(--bh-primary);
    border-color: var(--bh-primary);
    color: #FFFFFF;
}

.btn-primary:hover, .btn-bh-primary:hover {
    background-color: var(--bh-primary-hover);
    border-color: var(--bh-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.25);
}

.btn-outline-secondary {
    border-color: var(--bh-border);
    color: var(--bh-slate);
    background-color: #FFFFFF;
}

.btn-outline-secondary:hover {
    background-color: var(--bh-gray-light);
    border-color: #CBD5E1;
    color: var(--bh-dark);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--bh-radius-sm);
    border: 1.5px solid var(--bh-border);
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    background-color: #FFFFFF;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bh-primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

/* Badges */
.badge {
    border-radius: var(--bh-radius-sm);
    font-weight: 600;
    padding: 0.4em 0.75em;
    letter-spacing: 0.02em;
}

.badge-ready {
    background-color: #DEF7EC;
    color: #03543F;
}

.badge-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-live {
    background-color: #FEE2E2;
    color: #991B1B;
    animation: pulse-badge 1.8s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

/* Navbar & Sidebar */
.bh-navbar {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--bh-border);
    box-shadow: var(--bh-shadow-sm);
}

.bh-sidebar {
    background-color: #FFFFFF;
    border-right: 1px solid var(--bh-border);
    min-height: calc(100vh - 65px);
}

[dir="rtl"] .bh-sidebar {
    border-right: none;
    border-left: 1px solid var(--bh-border);
}

.bh-nav-item {
    color: var(--bh-slate);
    border-radius: var(--bh-radius-sm);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}

.bh-nav-item:hover {
    background-color: var(--bh-primary-light);
    color: var(--bh-primary);
}

.bh-nav-item.active {
    background-color: var(--bh-primary);
    color: #FFFFFF;
    font-weight: 600;
}

/* Native Classroom Video Grid */
.classroom-container {
    background-color: #0B0F19;
    border-radius: var(--bh-radius-lg);
    overflow: hidden;
    color: #FFFFFF;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
    flex: 1;
    background-color: #111827;
}

.video-tile {
    background-color: #1F2937;
    border-radius: var(--bh-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.video-tile.active-speaker {
    border-color: var(--bh-primary);
    box-shadow: 0 0 15px rgba(0, 87, 255, 0.4);
}

.participant-label {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: var(--bh-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: #FFFFFF;
}

[dir="rtl"] .participant-label {
    left: auto;
    right: 12px;
}

/* Whiteboard Canvas */
.whiteboard-wrapper {
    background-color: #FFFFFF;
    border-radius: var(--bh-radius);
    border: 1px solid var(--bh-border);
    position: relative;
    overflow: hidden;
}

.whiteboard-toolbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--bh-border);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.whiteboard-tool-btn {
    border-radius: var(--bh-radius-sm);
    border: 1px solid var(--bh-border);
    background: #FFFFFF;
    color: var(--bh-slate);
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.whiteboard-tool-btn:hover, .whiteboard-tool-btn.active {
    background: var(--bh-primary);
    color: #FFFFFF;
    border-color: var(--bh-primary);
}

/* Chat Panel */
.classroom-chat {
    background-color: #FFFFFF;
    border-left: 1px solid var(--bh-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

[dir="rtl"] .classroom-chat {
    border-left: none;
    border-right: 1px solid var(--bh-border);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.65rem 0.9rem;
    border-radius: var(--bh-radius);
    font-size: 0.9rem;
}

.chat-bubble-received {
    background-color: var(--bh-gray-light);
    border: 1px solid var(--bh-border);
    align-self: flex-start;
}

.chat-bubble-sent {
    background-color: var(--bh-primary);
    color: #FFFFFF;
    align-self: flex-end;
}
