:root {
    --primary-red: #ff0000;
    --dark-bg: #050505;
    --glass: rgba(10, 10, 10, 0.98);
    --border-red: #880000;
}

* { box-sizing: border-box; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

body {
    margin: 0; background: var(--dark-bg); color: #fff;
    font-family: 'Cairo', 'Orbitron', sans-serif;
    height: 100vh; width: 100vw; overflow: hidden;
}

#glow-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(255,0,0,0.1) 0%, transparent 85%);
    pointer-events: none; z-index: 1;
}

.screen {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh; width: 100%; position: absolute; z-index: 2;
}

.screen.active { display: flex; animation: screenIn 0.6s forwards; }

@keyframes screenIn { from { opacity: 0; filter: blur(10px); } to { opacity: 1; filter: blur(0); } }

.glass-card {
    background: var(--glass); padding: 45px; border-radius: 12px;
    border: 2px solid var(--border-red); width: 90%; max-width: 480px;
    text-align: center; position: relative; box-shadow: 0 0 50px rgba(255,0,0,0.1);
}

.logo-main { max-width: 140px; margin-bottom: 25px; filter: drop-shadow(0 0 15px var(--primary-red)); }

.terminal-container {
    background: #000; padding: 15px; border-radius: 6px;
    height: 140px; margin-bottom: 25px; text-align: left;
    font-family: monospace; font-size: 13px; color: #ff3333;
    border: 1px solid #440000; overflow-y: auto;
}

input, select {
    width: 100%; padding: 14px; margin: 12px 0; background: #000;
    border: 1px solid #550000; color: #fff; border-radius: 6px;
}

input:focus, select:focus { border-color: var(--primary-red); box-shadow: 0 0 15px rgba(255,0,0,0.4); outline: none; }

.btn-group { display: flex; gap: 12px; flex-direction: column; margin-top: 20px; }

.btn-primary, .btn-danger, .btn-admin-access, .btn-send-chat, .btn-action {
    width: 100%; padding: 14px; border: none; border-radius: 6px;
    font-weight: 700; cursor: pointer; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

.btn-primary { background: #fff; color: #000; margin: 5px 0; }
.btn-danger { background: linear-gradient(45deg, #800, #f00); color: #fff; box-shadow: 0 4px 15px rgba(255,0,0,0.3); }
.btn-admin-access { background: transparent; border: 1px solid #444; color: #aaa; }

.screen-chat { display: none; height: 100vh; width: 100vw; grid-template-columns: 280px 1fr; z-index: 5; background: #000; position: fixed; top: 0; left: 0; }
.sidebar { background: #080808; border-left: 2px solid #1a0000; padding: 20px; display: flex; flex-direction: column; overflow-y: auto; height: 100%; }
.logo-sidebar { width: 40px; height: auto; filter: drop-shadow(0 0 5px var(--primary-red)); }
.sidebar-header { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-family: 'Orbitron'; font-weight: bold; }
.chat-tag { background: #111; padding: 10px; border-radius: 5px; margin: 5px 0; border-right: 3px solid var(--primary-red); font-size: 11px; }

.sidebar-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.btn-action { background: #111; border: 1px solid #333; color: #eee; font-size: 13px; text-align: right; justify-content: flex-start; padding: 10px; }

.chat-area { display: flex; flex-direction: column; background: radial-gradient(circle at center, #0a0000 0%, #000 100%); height: 100%; position: relative; overflow: hidden; }
#messages-container { flex: 1; overflow-y: scroll; padding: 30px; display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth; }

.msg { padding: 14px 18px; border-radius: 12px; max-width: 85%; line-height: 1.6; font-size: 15px; word-wrap: break-word; position: relative; opacity: 0; animation: msgFadeIn 0.5s forwards; display: flex; align-items: center; gap: 12px; }
@keyframes msgFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.msg.user { background: #151515; align-self: flex-start; border: 1px solid #333; border-top-right-radius: 2px; }
.msg.bot { background: linear-gradient(135deg, #0d0000, #1a0000); align-self: flex-end; border: 1px solid #440000; border-top-left-radius: 2px; flex-direction: row-reverse; }

.msg-img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 1px solid var(--primary-red); flex-shrink: 0; }

.copy-btn { position: absolute; top: 5px; right: 5px; background: #333; color: #fff; border: none; border-radius: 4px; padding: 4px 8px; font-size: 10px; cursor: pointer; opacity: 0.6; }
.copy-btn:hover { opacity: 1; }

.typing-indicator { color: var(--primary-red); padding: 10px 30px; font-size: 14px; font-weight: bold; animation: typingGlow 1.5s infinite alternate, typingIn 0.4s forwards; display: flex; align-items: center; }
@keyframes typingGlow { from { text-shadow: 0 0 5px #f00; } to { text-shadow: 0 0 15px #f00, 0 0 20px #800; } }
@keyframes typingIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.input-box-wrapper { padding: 20px 30px; background: #000; border-top: 1px solid #222; }
.input-box-container { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 900px; margin: 0 auto; }
.model-selector-wrapper { width: 180px; align-self: flex-start; }
.model-selector-wrapper select { margin: 0; padding: 8px; font-size: 12px; height: 35px; background: #0a0a0a; border: 1px solid #333; }
.input-box { background: #0a0a0a; border: 2px solid #333; border-radius: 10px; display: flex; padding: 5px; gap: 5px; align-items: center; }
.input-box input { flex: 1; border: none; background: transparent; margin: 0; padding: 12px; height: 45px; }
.btn-send-chat { width: auto; background: var(--primary-red); color: #fff; padding: 0 25px; border-radius: 8px; font-size: 14px; height: 45px; white-space: nowrap; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.98); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.admin-card, .alert-box { background: #0a0a0a; padding: 30px; border: 2px solid var(--primary-red); border-radius: 12px; text-align: center; position: relative; }
.hidden { display: none !important; }
.btn-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
