/* ==========================================================================
   ELITE AI COACH CSS
   Glassmorphism, Chat UI, Animations
   ========================================================================== */

/* Layout & Globals */
.aic-container { margin-left: 20px; padding: 32px; height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.aic-layout { display: flex; gap: 24px; flex-grow: 1; height: calc(100vh - 120px); min-height: 0; }
.aic-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 16px; overflow-y: auto; }
.aic-chat-main { flex-grow: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 24px; padding: 24px; position: relative; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.hidden-mobile { display: flex; }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } .aic-sidebar { display: none; } }
.m-0 { margin: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.pb-16 { padding-bottom: 16px; } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .text-center { text-align: center; } .cursor-pointer { cursor: pointer; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-white { color: #ffffff; } .text-pink { color: #f472b6; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); } 70% { box-shadow: 0 0 0 15px rgba(6,182,212,0); } 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0); } }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-4px); opacity: 1; } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }
.pulse-glow { animation: pulseGlow 3s infinite; border-radius: 50%; }

/* Buttons & Inputs */
.aic-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.aic-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.aic-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.aic-btn--massive { padding: 16px 24px; font-size: 1rem; border-radius: 16px; }
.aic-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; }
.aic-btn-icon:hover { color: white; transform: scale(1.1); }
.aic-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.aic-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }

.aic-search { position: relative; width: 100%; }
.aic-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); }
.aic-search input { width: 100%; padding: 10px 14px 10px 36px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; outline: none; font-size: 0.85rem; }
.aic-search input:focus { border-color: #c084fc; }

/* Header */
.aic-header { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 8px; flex-shrink: 0; }
.aic-header__title { font-size: 2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.aic-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.aic-header__actions { display: flex; gap: 16px; align-items: center; }
.aic-model-indicator { background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3); padding: 6px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 700; color: #fff; cursor: pointer; transition: 0.2s; }
.aic-model-indicator:hover { background: rgba(6,182,212,0.2); }

/* Sidebar List */
.aic-filter-chips { display: flex; gap: 8px; }
.aic-chip { background: rgba(255,255,255,0.05); border: 1px solid transparent; color: rgba(255,255,255,0.6); padding: 4px 12px; border-radius: 16px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: 0.2s; }
.aic-chip:hover { color: white; background: rgba(255,255,255,0.1); }
.aic-chip.active { background: rgba(192,132,252,0.2); color: #c084fc; border-color: rgba(192,132,252,0.4); }

.aic-convs-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.aic-conv-item { padding: 12px; border-radius: 12px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.aic-conv-item:hover { background: rgba(255,255,255,0.05); }
.aic-conv-item.active { background: rgba(6,182,212,0.05); border-color: rgba(6,182,212,0.3); box-shadow: inset 0 0 10px rgba(6,182,212,0.1); }
.c-tit { font-weight: 700; font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.c-desc { font-size: 0.75rem; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty State */
.aic-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }
.aic-avatar-giant { width: 80px; height: 80px; background: linear-gradient(135deg, #06b6d4, #a855f7); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: white; border: 2px solid #000; }
.aic-suggestions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 600px; margin-top: 24px; }
.aic-sug-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 16px; border-radius: 12px; text-align: left; font-size: 0.9rem; font-family: inherit; color: rgba(255,255,255,0.8); cursor: pointer; transition: 0.2s; }
.aic-sug-card:hover { border-color: #c084fc; background: rgba(192,132,252,0.1); color: #fff; transform: translateY(-2px); }
.aic-sug-card i { margin-right: 8px; }

/* Active Chat */
.aic-chat-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; }
.aic-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; padding-right: 8px; scrollbar-width: thin; }
.aic-messages::-webkit-scrollbar { width: 6px; }
.aic-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.aic-message { display: flex; gap: 16px; max-width: 85%; animation: fadeInUp 0.3s ease-out forwards; }
.aic-message.user { align-self: flex-end; flex-direction: row-reverse; }
.aic-message.ai { align-self: flex-start; }

.aic-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.aic-avt-ai { background: linear-gradient(135deg, #06b6d4, #a855f7); color: white; }
.aic-avt-user { background: #333; color: white; }

.aic-bubble { padding: 16px 20px; font-size: 0.95rem; line-height: 1.6; position: relative; }
.aic-message.user .aic-bubble { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(0,0,0,0.5)); border: 1px solid rgba(192,132,252,0.3); border-radius: 16px 16px 4px 16px; color: #fff; }
.aic-message.ai .aic-bubble { background: rgba(0,0,0,0.4); border: 1px solid rgba(6,182,212,0.2); border-radius: 16px 16px 16px 4px; color: rgba(255,255,255,0.9); }

/* Markdown Styles inside Bubbles */
.aic-bubble p { margin: 0 0 12px 0; }
.aic-bubble p:last-child { margin-bottom: 0; }
.aic-bubble strong { color: #fff; }
.aic-bubble em { color: rgba(255,255,255,0.85); font-style: italic; }
.aic-bubble code { background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 4px; font-family: monospace; color: #fbbf24; font-size: 0.9em; }
.aic-bubble pre { background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 12px 14px; margin: 8px 0 12px 0; overflow-x: auto; }
.aic-bubble pre code { background: transparent; padding: 0; color: #e5e7eb; }
.aic-bubble h3, .aic-bubble h4, .aic-bubble h5 { color: #fff; margin: 16px 0 8px 0; line-height: 1.3; }
.aic-bubble h3 { font-size: 1.05rem; }
.aic-bubble h4 { font-size: 0.98rem; }
.aic-bubble h5 { font-size: 0.9rem; color: rgba(255,255,255,0.85); }
.aic-bubble h3:first-child, .aic-bubble h4:first-child, .aic-bubble h5:first-child { margin-top: 0; }
.aic-bubble ul, .aic-bubble ol { margin: 6px 0 12px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.aic-bubble ul:last-child, .aic-bubble ol:last-child { margin-bottom: 0; }
.aic-bubble li { margin: 0; line-height: 1.55; }
.aic-bubble ul li::marker { color: #06b6d4; }
.aic-bubble ol li::marker { color: #c084fc; font-weight: 700; }
.aic-bubble blockquote { margin: 8px 0 12px 0; padding: 8px 14px; border-left: 3px solid rgba(6,182,212,0.6); background: rgba(6,182,212,0.06); color: rgba(255,255,255,0.85); border-radius: 0 8px 8px 0; }
.aic-bubble hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 14px 0; }
.aic-citation { display: inline-flex; align-items: center; gap: 4px; background: rgba(6,182,212,0.15); border: 1px solid rgba(6,182,212,0.3); color: #06b6d4; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: 0.2s; text-decoration: none; margin: 0 4px; }
.aic-citation:hover { background: #06b6d4; color: #000; }

.aic-msg-actions { display: flex; gap: 12px; margin-top: 8px; opacity: 0; transition: 0.2s; justify-content: flex-end; }
.aic-message:hover .aic-msg-actions { opacity: 1; }
.act-btn { background: transparent; border: none; color: rgba(255,255,255,0.4); cursor: pointer; font-size: 0.85rem; transition: 0.2s; }
.act-btn:hover { color: #fff; }

/* Streaming */
.aic-streaming { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.aic-typing-dots { display: flex; gap: 4px; background: rgba(0,0,0,0.4); border: 1px solid rgba(6,182,212,0.2); padding: 12px 16px; border-radius: 16px 16px 16px 4px; }
.dot { width: 8px; height: 8px; background: #06b6d4; border-radius: 50%; animation: typing 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* Input Bar */
.aic-input-container { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 16px; flex-shrink: 0; }
.aic-input-wrapper { display: flex; gap: 12px; align-items: flex-end; }
.aic-textarea { flex-grow: 1; background: transparent; border: none; color: white; font-family: inherit; font-size: 1rem; line-height: 1.5; resize: none; outline: none; padding: 8px 0; max-height: 150px; overflow-y: auto; }
.aic-send-btn { width: 44px; height: 44px; border-radius: 50%; background: #c084fc; color: #000; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: 0.2s; flex-shrink: 0; }
.aic-send-btn:hover:not(:disabled) { transform: scale(1.1); box-shadow: 0 0 15px rgba(192,132,252,0.5); }
.aic-send-btn:disabled { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.3); cursor: not-allowed; }

/* Modals */
.aic-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.aic-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.aic-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.aic-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.aic-modal__close:hover { color: white; }

.aic-persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: 60vh; overflow-y: auto; }
.p-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 14px; border-radius: 12px; cursor: pointer; transition: 0.18s; display: flex; align-items: flex-start; gap: 12px; }
.p-card:hover { border-color: #06b6d4; background: rgba(6,182,212,0.1); }
.p-card--active { border-color: #06b6d4 !important; background: rgba(6,182,212,0.18) !important; box-shadow: 0 0 0 2px rgba(6,182,212,0.35); }
.p-ico { font-size: 1.8rem; line-height: 1; }
#persona-custom-text { background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; max-height: 120px; }
#persona-custom-text:focus { border-color: #06b6d4; outline: none; }

.aic-radio-list { display: flex; flex-direction: column; gap: 12px; }
.aic-radio-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.9rem; color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.2); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: 0.2s; }
.aic-radio-row:hover { background: rgba(255,255,255,0.05); border-color: rgba(192,132,252,0.3); }
.aic-radio-row input { accent-color: #c084fc; width: 18px; height: 18px; cursor: pointer; }