:root { --prime-bg: #121212; --prime-bg-2: #1e1e1e; --prime-accent: linear-gradient(45deg, #fff, #4D5555); --rose: #000; }
html, body { height: 100%; scroll-behavior: smooth; }
body { font-family: 'Cairo', sans-serif; background-color: var(--prime-bg); color: #fff; overflow-x: hidden; }
.prime-gradient { background: linear-gradient(90deg, var(--prime-bg) 0%, var(--prime-bg-2) 100%); }
.soft-card { border-radius: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.ltr {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}
.fade-in { animation: fadeIn .8s ease-in-out forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: translateY(0) } }
#stars-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; background: #000000; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.2rem; border-radius: .75rem; font-weight: 700; transition: all .2s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(45deg, #555555, #4D5555); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }
@keyframes moveGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.moving-bg { background: linear-gradient(-45deg, #121212, #1e1e1e, #4d5555, #111827); background-size: 400% 400%; animation: moveGradient 15s ease infinite; }        
.btn-ghost { background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(75, 85, 99, .8); }
@keyframes pulseGlow { 0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); } 50% { box-shadow: 0 0 20px rgba(85,85,85,0.4); } 100% { box-shadow: 0 0 5px rgba(253, 0, 0, 0.1); } }
.btn-pulse { animation: pulseGlow 4s infinite; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.shimmer-text { background: linear-gradient(90deg, #555, #fff, #555); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: shimmer 3s linear infinite; }
.btn-ghost:hover:not(:disabled) { background: rgba(75, 85, 99, .75); }
.poster-card { cursor: pointer; }
.rating { position: absolute; top: 0.75rem; inset-inline-end: 0.75rem; background: rgba(0, 0, 0, 0.7); padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 0.25rem; backdrop-filter: blur(4px); }
.hint { color: #aab3be; font-size: .9rem; }
.error-box { background: rgba(154, 141, 141, 0.15); border: 1px solid rgba(68, 68, 68, 0.45); color: #ffffff; padding: 1rem; border-radius: 1rem; text-align: center; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--rose); border-radius: 50%; width: 42px; height: 42px; animation: spin 1s linear infinite; margin: 2rem auto; }
@keyframes spin { 0% { transform: rotate(0) } 100% { transform: rotate(360deg) } }
.input, select.input { background: #2e2e2e; color: white; border-radius: .75rem; padding: .65rem .9rem; outline: none; border: 1px solid transparent; width: 100%; transition: all .2s; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-position: left 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 0.9rem; padding-left: 2.5rem; }
.input:focus, select.input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(204, 204, 204, 0.25) }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; padding: 1rem; transition: opacity .3s, visibility .3s; opacity: 1; visibility: visible;}
.overlay.hidden { opacity: 0; visibility: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.modal.show { opacity: 1; visibility: visible; }
.modal-content { background: var(--prime-bg-2); border-radius: 1rem; max-width: 900px; width: 100%; display: flex; flex-direction: column; overflow: hidden; max-height: 90vh; transform: scale(0.95); transition: transform .3s; }
.modal.show .modal-content { transform: scale(1); }
.modal-body { display: flex; flex-direction: column; gap: 1.5rem; padding: 0 1.5rem 1.5rem; overflow-y: auto; }
.modal-body-details { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.modal-poster-container { width: 100%; flex-shrink: 0; }
.modal-poster-container img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.75rem; box-shadow: 0 5px 20px rgba(0,0,0,.3); }
@media (min-width: 768px) { .modal-body { flex-direction: row; } .modal-poster-container { width: 250px; } }
.overview-text { max-height: 120px; overflow-y: auto; padding-left: 8px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.overview-text::-webkit-scrollbar { width: 5px; } .overview-text::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 10px; } .overview-text::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.5); border-radius: 10px; }
.categories-nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.categories-nav::-webkit-scrollbar { display: none; }
.categories-nav a { display: inline-block; padding: 0.5rem 1rem; font-weight: bold; color: #aab3be; border-bottom: 3px solid transparent; transition: all 0.2s ease; }
.categories-nav a:hover { color: #fff; }
.categories-nav a.active { color: white; border-image: var(--prime-accent); border-image-slice: 1; border-bottom-style: solid; border-bottom-width: 3px; }
.recommendations-carousel { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.rec-card { flex-shrink: 0; width: 140px; } .rec-card img { width: 100%; height: auto; border-radius: 0.5rem; margin-bottom: 0.5rem; } .rec-card p { font-size: 0.875rem; font-weight: bold; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-tag { background-color: rgba(255, 255, 255, 0.1); padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; }
#hero { transition: background-image 0.5s ease-in-out; }
#toast { position: fixed; bottom: -140px; left: 50%; transform: translateX(-50%); background: linear-gradient(45deg, #4d4d4d, #2a2a2a); color: white; padding: 0.75rem 1.5rem; border-radius: 9999px; z-index: 200; font-weight: bold; transition: bottom 0.5s ease-in-out; text-align: center; line-height: 1.35; max-width: min(92vw, 560px); white-space: normal; }
#toast.show { bottom: 20px; }
#chat-overlay { z-index: 110; }
.chat-container { max-width: 800px; width: 100%; background: var(--prime-bg-2); border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; height: 80vh; max-height: 600px; }
.chat-header { padding: 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.chat-window { flex-grow: 1; padding: 1.5rem; overflow-y: auto; }
.chat-message { margin-bottom: 1rem; display: flex; flex-direction: column; } .chat-message.user { align-items: flex-end; } .chat-message.ai { align-items: flex-start; }
.chat-bubble { padding: 0.75rem 1rem; border-radius: 1rem; max-width: 80%; line-height: 1.6; } .chat-bubble.user { background: linear-gradient(45deg, #191919, #191919); border-bottom-right-radius: 0.25rem; } .chat-bubble.ai { background: #191919; border-bottom-left-radius: 0.25rem; }
.chat-bubble snovie-link { text-decoration: underline; color: #dfdfdf; cursor: pointer; font-weight: bold; } .chat-bubble snovie-link:hover { color: #595959; }
.prompt-buttons { display: flex; gap: 0.5rem; padding: 0 1.5rem 0.5rem; overflow-x: auto; } .prompt-buttons::-webkit-scrollbar { display: none; }
.prompt-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.8rem; white-space: nowrap; cursor: pointer; transition: background-color 0.2s; }
.prompt-btn:hover { background: rgba(255,255,255,0.2); }
#chat-form { display: flex; padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
#fab-chat-btn { position: fixed; bottom: 1.5rem; inset-inline-start: 1.5rem; z-index: 45; width: 3.5rem; height: 3.5rem; border-radius: 50%; padding: 0; font-size: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

/* LTR polish for input groups (search + chat) */
html[dir="ltr"] #search-input { border-radius: .75rem 0 0 .75rem !important; border-right: none !important; border-left: 1px solid #252525 !important; }
html[dir="ltr"] #search-btn { border-radius: 0 .75rem .75rem 0 !important; border-left: none !important; border-right: 1px solid #252525 !important; }
html[dir="ltr"] #chat-input { border-radius: .75rem 0 0 .75rem !important; }
html[dir="ltr"] #chat-send-btn { border-radius: 0 .75rem .75rem 0 !important; }

html[dir="ltr"] select.input { background-position: right 0.5rem center; padding-right: 2.5rem; padding-left: 0.9rem; }
.gif-bg {
background-image: url("https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3OTJ6dzI2cWpldXMxYnk3d2tzZ3Jmd2I4aDBpeTloaTQ1ODg0dDhubiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/fSRQtBAzrPokPCItuu/giphy.gif");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
position: relative;
overflow: hidden;
}

/* طبقة تعتيم للنص */
.gif-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 18, 0.50);
    z-index: 0;
}

/* خلي المحتوى فوق التعتيم */
.gif-bg > * {
    position: relative;
    z-index: 1;
}
.gif-text {
background-image: url("https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNHN5MnBxMDU5cG0yMDRvbmc1eWozcDBoa2J0dDNjajBocmc0ZmxjOSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/xUOxeSTrDP4vsF2TXq/giphy.gif");
background-size: cover;
background-position: center;
background-repeat: no-repeat;

-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;

display: inline-block;
}

