/* ========================================================
   WormGPT - Exact 1:1 Pixel Matching Styles & Hyper Glow
   ======================================================== */

:root {
    --cyber-black: #070404;
    --cyber-dark: #080303;
    --cyber-card: #120505;
    --cyber-hover: #1c0a0a;
    --cyber-border: #1f0b0b;
    --cyber-red: #e50914;
    --cyber-red-glow: rgba(229, 9, 20, 0.6);
}

/* Subtle Red Cyber Grid Pattern Overlay */
.cyber-grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, rgba(229, 9, 20, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(229, 9, 20, 0.035) 1px, transparent 1px);
    background-size: 38px 38px;
    z-index: 1;
}

/* Subtle Crimson Ambient Glow in the background */
.cyber-glow-bg {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.1) 0%, rgba(229, 9, 20, 0.02) 50%, transparent 70%);
    filter: blur(100px);
    pointer-events: none;
    z-index: 1;
}

/* Side Ambient Glow between hero text and preview card */
.side-ambient-glow {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.42) 0%, rgba(229, 9, 20, 0.22) 35%, rgba(229, 9, 20, 0.08) 60%, transparent 75%);
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

/* Second Ambient Glow Layer for depth and intensity */
.side-ambient-glow-center {
    position: absolute;
    top: 45%;
    right: 35%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.35) 0%, rgba(229, 9, 20, 0.15) 45%, transparent 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

/* Preview Card Original Gradient & Texture */
.hero-preview-card {
    background: linear-gradient(180deg, #140707 0%, #0d0404 45%, #080202 100%);
    border: 1px solid #381414;
    box-shadow: 0 0 50px rgba(229, 9, 20, 0.22), inset 0 1px 0 rgba(229, 9, 20, 0.25);
}

.hero-prompt-bubble {
    background: #170808;
    border: 1px solid #321212;
}

.hero-input-box {
    background: #0b0404;
    border: 1px solid #2c0e0e;
}

/* Hero Enlarged Button Glow */
.hero-glow-btn {
    box-shadow: 0 0 35px rgba(229, 9, 20, 0.7), 0 0 75px rgba(229, 9, 20, 0.35);
}
.hero-glow-btn:hover {
    box-shadow: 0 0 50px rgba(229, 9, 20, 0.9), 0 0 100px rgba(229, 9, 20, 0.5);
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #260f0f;
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--cyber-red);
}

/* Hyper Pulsing Glow Animation for Center Red Flower Logo */
@keyframes hyperPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(229, 9, 20, 0.95)) drop-shadow(0 0 45px rgba(229, 9, 20, 0.5));
    }
    50% {
        opacity: 0.85;
        transform: scale(0.98);
        filter: drop-shadow(0 0 12px rgba(229, 9, 20, 0.7)) drop-shadow(0 0 25px rgba(229, 9, 20, 0.3));
    }
}

.animate-pulse-slow {
    animation: hyperPulse 3s infinite ease-in-out;
}

/* ==================== HYPER EMBER GLOW ("مجمرة") STYLING ==================== */

/* Send Button: Super intense red ember halo (matches Image 1 & 3 exactly) */
.send-btn-ember {
    background: #e50914 !important;
    box-shadow: 0 0 22px #e50914, 0 0 45px rgba(229, 9, 20, 0.75), 0 0 70px rgba(229, 9, 20, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.3) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.send-btn-ember:hover {
    background: #ff1f2d !important;
    box-shadow: 0 0 30px #e50914, 0 0 60px rgba(229, 9, 20, 0.95), 0 0 90px rgba(229, 9, 20, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.45) !important;
    transform: scale(1.06);
}

.send-btn-ember:active {
    transform: scale(0.95);
    box-shadow: 0 0 18px rgba(229, 9, 20, 0.9) !important;
}

/* Input Card: Dark-reddish undertone (#120505) with crimson ember border */
.input-card-ember {
    background: #120505 !important;
    border: 1px solid #381010 !important;
    box-shadow: 0 0 35px rgba(229, 9, 20, 0.12), 0 10px 40px rgba(0, 0, 0, 0.85) !important;
    transition: all 0.25s ease;
}

.input-card-ember:focus-within {
    border-color: rgba(229, 9, 20, 0.6) !important;
    box-shadow: 0 0 45px rgba(229, 9, 20, 0.25), 0 12px 45px rgba(0, 0, 0, 0.9) !important;
}

/* Pill Buttons inside Input: Dark-red reddish background like Image 1 & 3 */
.input-pill-btn {
    background: #1a0808 !important;
    border: 1px solid #331010 !important;
    color: #a1a1aa !important;
    transition: all 0.2s ease;
}

.input-pill-btn:hover {
    background: #240b0b !important;
    border-color: rgba(229, 9, 20, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(229, 9, 20, 0.35) !important;
}

/* Active Glowing Cyberpunk Red Pill (Lights up in Red as requested) */
.input-pill-btn.active {
    background: #360a0a !important;
    border-color: #e50914 !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(229, 9, 20, 0.65), inset 0 0 8px rgba(229, 9, 20, 0.3) !important;
}

.input-pill-btn.active svg {
    color: #ff3845 !important;
    filter: drop-shadow(0 0 6px rgba(229, 9, 20, 0.9)) !important;
}

/* Active Conversation Item */
.conversation-item.active {
    background: #180808;
    border: 1px solid #381212;
    color: #e05a5a !important;
}

/* User Message Card */
.user-message-card {
    background: #1a0808;
    border: 1px solid #361212;
    border-radius: 18px;
    padding: 12px 18px;
    color: #f3f4f6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 80%;
}

.assistant-message-card {
    background: transparent;
    color: #e5e7eb;
    line-height: 1.7;
    width: 100%;
}

/* Code Block Window */
.code-window {
    background: #090404;
    border: 1px solid #2d1010;
    border-radius: 14px;
    margin: 14px 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    direction: ltr !important;
    text-align: left !important;
}

.code-header {
    background: #120606;
    border-bottom: 1px solid #240d0d;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-file-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #fca5a5;
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-action-btn {
    padding: 4px 8px;
    border-radius: 6px;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.code-action-btn:hover {
    color: #ffffff;
    background: rgba(229, 9, 20, 0.2);
    border-color: rgba(229, 9, 20, 0.4);
}

.code-content-wrapper {
    display: flex;
    padding: 12px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
}

.code-line-numbers {
    padding: 0 14px;
    text-align: right;
    color: #484848;
    user-select: none;
    border-right: 1px solid #1f0a0a;
    font-size: 11px;
}

.code-content {
    flex: 1;
    padding: 0 16px;
    margin: 0;
    background: transparent !important;
}

/* Markdown styling */
.markdown-body p {
    margin-bottom: 0.85em;
}

.markdown-body ul, .markdown-body ol {
    margin-bottom: 0.85em;
    padding-inline-start: 1.5em;
}

.markdown-body li {
    margin-bottom: 0.35em;
    list-style-type: disc;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #ffffff;
    font-weight: 700;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

.markdown-body code:not(pre code) {
    background: #240e0e;
    color: #f87171;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    border: 1px solid #3d1616;
}

.markdown-body blockquote {
    border-inline-start: 3px solid var(--cyber-red);
    padding-inline-start: 12px;
    color: #9ca3af;
    margin: 12px 0;
    font-style: italic;
}



/* ==================== FULLSCREEN CODE MODAL (Exact match to Original Site) ==================== */
#fullscreenCodeModal {
    backdrop-filter: blur(8px);
}

#fullscreenCodeContainer {
    animation: fullscreenCodeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fullscreenCodeIn {
    from {
        opacity: 0;
        transform: scale(0.985);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== RTL (ARABIC) POLISH ==================== */
html[dir="rtl"] {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

html[dir="rtl"] #sidebar {
    border-right: none !important;
    border-left: 1px solid #1f0b0b !important;
}

html[dir="rtl"] #modelDropdown {
    left: auto !important;
    right: 0 !important;
    text-align: right !important;
}

html[dir="rtl"] .code-window,
html[dir="rtl"] pre,
html[dir="rtl"] code {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="rtl"] #v4ToastNotification {
    left: 1.5rem !important;
    right: auto !important;
}

html[dir="rtl"] .user-message-card {
    text-align: right !important;
}

html[dir="rtl"] .assistant-message-card {
    text-align: right !important;
}

