/* assets/css/style.css */

/* Base Settings */
html, body {
    overflow-x: hidden; /* Prevents the site from sliding sideways */
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

body { font-family: 'Inter', sans-serif; }
body.rtl { font-family: 'Tajawal', sans-serif; }

/* Hero Background */
.hero-bg {
    background-color: #0c143e;
    background-image: radial-gradient(circle at top right, rgba(14, 165, 233, 0.3), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.2), transparent 50%);
}
[dir="rtl"] .hero-bg {
    background-image: radial-gradient(circle at top left, rgba(14, 165, 233, 0.3), transparent 40%),
                      radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.2), transparent 50%);
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.3s;
    text-align: left;
    direction: ltr;
    font-family: 'Inter', sans-serif;
}
.form-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.form-input[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

/* RTL / Arabic Input Fixes */
body.rtl .form-input {
    text-align: right;
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
}
body.rtl .form-input::placeholder {
    text-align: right;
}

/* Exception: Email must always be LTR */
body.rtl .form-input.ltr-input {
    text-align: left;
    direction: ltr;
    font-family: 'Inter', sans-serif;
}
body.rtl .form-input.ltr-input::placeholder {
    text-align: left;
}

/* Modal */
.modal-open { overflow: hidden; }

/* Legal Modal Body — enterprise dark typography */
.legal-modal-body {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.75;
}
.legal-modal-body p {
    margin-bottom: 1.1rem;
}
.legal-modal-body p strong {
    display: block;
    color: #7dd3fc;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.legal-modal-body p strong + br {
    display: none;
}
.legal-modal-body em {
    color: #cbd5e1;
    font-style: normal;
    font-weight: 600;
}
.legal-modal-body::-webkit-scrollbar { width: 3px; }
.legal-modal-body::-webkit-scrollbar-track { background: transparent; }
.legal-modal-body::-webkit-scrollbar-thumb { background: rgba(14,165,233,0.25); border-radius: 4px; }
.legal-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(14,165,233,0.45); }

/* ── Chat Bot Markdown Rendering ─────────────────────────────────────────── */
.bot-content { overflow-x: hidden; }

.bot-content p { margin-bottom: 0.6rem; }
.bot-content p:last-child { margin-bottom: 0; }

.bot-content h1, .bot-content h2, .bot-content h3, .bot-content h4 {
    color: #7dd3fc;
    font-weight: 700;
    margin-top: 0.9rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}
.bot-content h1 { font-size: 1rem; }
.bot-content h2 { font-size: 0.9375rem; }
.bot-content h3 { font-size: 0.875rem; letter-spacing: 0.02em; }
.bot-content h4 { font-size: 0.8125rem; color: #93c5fd; }
.bot-content h1:first-child,
.bot-content h2:first-child,
.bot-content h3:first-child { margin-top: 0; }

.bot-content strong { color: #e2e8f0; font-weight: 600; }
.bot-content em     { color: #93c5fd; font-style: normal; }

.bot-content ul, .bot-content ol {
    margin: 0.4rem 0 0.6rem 1.1rem;
    padding: 0;
}
.bot-content ul { list-style: disc; }
.bot-content ol { list-style: decimal; }
.bot-content li { margin-bottom: 0.2rem; }
.bot-content li > ul, .bot-content li > ol { margin-top: 0.2rem; margin-bottom: 0.2rem; }

/* Tables — scrollable so they don't overflow the 360 px bubble */
.bot-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin: 0.6rem 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.bot-content th, .bot-content td {
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(14,165,233,0.18);
    text-align: left;
    white-space: nowrap;
}
.bot-content th {
    background: rgba(14,165,233,0.1);
    color: #7dd3fc;
    font-weight: 600;
}
.bot-content tr:nth-child(even) td { background: rgba(255,255,255,0.025); }

.bot-content code {
    background: rgba(0,0,0,0.35);
    color: #86efac;
    font-size: 0.8rem;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}
.bot-content pre {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(14,165,233,0.15);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.bot-content pre code { background: none; padding: 0; }

.bot-content blockquote {
    border-left: 3px solid rgba(14,165,233,0.45);
    background: rgba(14,165,233,0.04);
    margin: 0.5rem 0;
    padding: 0.35rem 0.65rem;
    color: #94a3b8;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}
.bot-content blockquote p { margin-bottom: 0; }

.bot-content a { color: #38bdf8; text-decoration: underline; text-underline-offset: 2px; }
.bot-content hr { border: none; border-top: 1px solid rgba(14,165,233,0.15); margin: 0.7rem 0; }

/* Cookie Banner */
#cookie-banner {
    z-index: 9999 !important; 
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-banner.translate-y-full {
    transform: translateY(100%) !important;
}

#cookie-banner:not(.translate-y-full) {
    transform: translateY(0) !important;
}

#cookie-banner > div {
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

/* Floating Language Button (FAB) */
#mobile-lang-fab {
    position: fixed !important; /* Force fixed positioning */
    z-index: 40; 
    bottom: 1.5rem; /* 24px */
    right: 1.5rem;  /* 24px */
}

/* In RTL mode, move the button to the left side */
body.rtl #mobile-lang-fab {
    right: auto;
    left: 1.5rem; 
}
/* --- Chatbot Positioning --- */

#neural-interface {
    z-index: 50; /* Above FAB (40) */
}

/* RTL Support for Chatbot */
/* In Arabic mode, move it to the left to align with the Language FAB */
body.rtl #neural-interface {
    right: auto;
    left: 1.25rem; /* Matches the FAB left position */
    align-items: flex-start; /* Align chat window to the left */
}

body.rtl #neural-window {
    transform-origin: bottom left; /* Animate from bottom-left in Arabic */
}
@keyframes neural-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.6); /* Sky-500 with opacity */
        transform: scale(1);
    }
    50% {
        transform: scale(1.05); /* Slight breathe */
    }
    70% {
        box-shadow: 0 0 0 15px rgba(14, 165, 233, 0); /* Expand and fade out */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
        transform: scale(1);
    }
}

.neural-active {
    animation: neural-pulse 2s infinite;
}

#chat-input::placeholder {
    color: #475569;
}
#dna-canvas {
    /* Ensure it doesn't capture mouse clicks */
    pointer-events: none; 
    /* Blend mode makes the glowing dots look better against the dark background */
    mix-blend-mode: screen; 
}