:root {
  --primary: #feb000;
  --background: #15161c;
  --surface: #191b23;
  --sidebar: #181921;
  --icon: #abb0bd;
  --icon-accent: #feb000;
  --highlight-bg: linear-gradient(135deg, #2d2a15 70%, #feb00087 200%);
  --font-main: 'Inter', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --fontsize: 13.2px;
  --sidebar-width: 70px;
  --border: #24252f;
  --corner-radius: 17px;
  --smooth-transition: 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  --bounce-transition: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body, html {
  margin:0; padding:0;
  background: var(--background);
  color: #edeff3;
  font-family: var(--font-main);
  font-size: var(--fontsize);
  height:100vh; min-height:100vh; width:100vw;
  overflow:hidden;
}

.layout {
  display: flex; height: 100vh; width: 100vw;
}

/* BOTTOM-RIGHT AUTH MODAL */
.auth-modal {
  position: fixed;
  bottom: 120px;
  right: 30px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: all var(--bounce-transition);
  backdrop-filter: blur(10px);
}

.auth-modal.show {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.auth-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 30%, #ff58a9 60%, #16ffd4 90%);
  border-radius: 16px 16px 0 0;
  animation: gradient-flow 8s linear infinite;
}

@keyframes gradient-flow {
  0% {background-position: 0% 50%;}
  100% {background-position: 100% 50%;}
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-modal-header h3 {
  color: var(--primary);
  font-size: 1.3em;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.auth-modal-header p {
  color: #b8b9bd;
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--smooth-transition);
}

.auth-modal-close:hover {
  color: var(--primary);
  background: rgba(254, 176, 0, 0.1);
}

.auth-tabs {
  display: flex;
  background: #222329;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  color: #b8b9bd;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--smooth-transition);
}

.auth-tab.active {
  background: var(--primary);
  color: #000;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: #18191e;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #f3f3f7;
  font-family: var(--font-main);
  outline: none;
  transition: all var(--smooth-transition);
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(254, 176, 0, 0.1);
}

.form-input::placeholder {
  color: #666;
  font-size: 12px;
}

.auth-btn {
  width: 100%;
  background: linear-gradient(90deg, var(--primary) 20%, #ff53bc 80%);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  transition: all var(--smooth-transition);
  transform: scale(1);
  margin-bottom: 12px;
}

.auth-btn:hover {
  transform: scale(1.02) translateY(-1px);
  box-shadow: 0 4px 15px rgba(254, 176, 0, 0.4);
}

.social-btn {
  width: 100%;
  background: #222329;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: #f3f3f7;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--smooth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.social-btn:hover {
  background: #2a2a2a;
  border-color: var(--primary);
}

.auth-divider {
  text-align: center;
  margin: 12px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  background: var(--surface);
  padding: 0 12px;
  color: #666;
  font-size: 11px;
}

.quick-login {
  background: #181a21;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  text-align: center;
}

.quick-login-text {
  color: #888;
  font-size: 11px;
  margin-bottom: 6px;
}

.quick-login-btn {
  background: rgba(254, 176, 0, 0.1);
  border: 1px solid rgba(254, 176, 0, 0.3);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--smooth-transition);
}

.quick-login-btn:hover {
  background: rgba(254, 176, 0, 0.2);
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-width: 56px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border);
  z-index:2;
  user-select:none;
  transition: width var(--smooth-transition);
}

.sidebar .brand {
  margin: 18px 0 27px 0; font-size:1.18em;
  color: var(--primary); font-weight:700;
  transition: all var(--smooth-transition);
}

.sidebar-nav {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  align-items: center; width: 100%;
  margin-bottom: 14px;
}

.sidebar-item {
  position:relative;
  color: var(--icon);
  font-size: 12.5px;
  width: 100%; text-align:center;
  padding: 13px 0 3px 0; margin-bottom: 4px;
  cursor:pointer; outline: none;
  border-radius: var(--corner-radius);
  transition: all var(--smooth-transition);
  font-weight: 500;
  z-index:1;
  transform: translateX(0);
}

.sidebar-item:hover {
  transform: translateX(2px);
}

.sidebar-item .icon {
  display: block; width: 24px; height: 24px; margin: 0 auto 2.5px auto;
  stroke-width: 1.6px;
  transition: all var(--smooth-transition);
}

.sidebar-item.active:before, .sidebar-item:focus:before, .sidebar-item:hover:before {
  content:""; position:absolute; left:6px; right:6px; top:3px; height:36px;
  background: var(--highlight-bg);
  border-radius:10px 8px 20px 10px/12px 16px 12px 16px;
  z-index:-1; box-shadow: 0 2px 10px #feb0001b;
  transition: all var(--bounce-transition);
  animation: smoothFadeIn .4s ease-out;
  opacity:0.95;
  transform: scale(1);
}

@keyframes smoothFadeIn{ 
  from{opacity:0; transform: scale(0.9);} 
  to{opacity:0.95; transform: scale(1);} 
}

.sidebar-item.active, .sidebar-item:focus, .sidebar-item:hover {
  color: var(--primary);
}

.sidebar-separator {
  width:40%; height:1.2px;
  background:var(--border);
  margin:7px 0 7px 0;
  border-radius:1.2px;
  transition: all var(--smooth-transition);
}

.sidebar-bottom {
  margin-bottom:8px; width:100%;
  display:flex; flex-direction:column; align-items:center; gap:7px;
}

.sidebar-bottom button {
  background:none; border:none; color:var(--icon);
  width:33px; height:32px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.07em; cursor:pointer; padding:2px;
  transition: all var(--smooth-transition);
  transform: scale(1);
}

.sidebar-bottom button:focus, .sidebar-bottom button:hover {
  color: var(--primary); 
  background: #23232333;
  transform: scale(1.1);
}

/* MAIN SECTION */
.mainsection {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition: all var(--smooth-transition);
}

.conversation-area {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 40px 0 140px 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  scroll-behavior: smooth;
}

.message-block {
  width: 100%;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.5s var(--smooth-transition) forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-query {
  background: transparent;
  border-left: 3px solid var(--primary);
  padding: 16px 0 16px 20px;
  font-size: 16px;
  font-weight: 500;
  color: #f5f5f7;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.assistant-response {
  background: transparent;
  padding: 20px 0;
  color: #e8e9ea;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0;
  animation: typewriter 0.8s ease-out 0.3s forwards;
}

@keyframes typewriter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.response-content {
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.response-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 8px 0;
  opacity: 0;
  animation: fadeInDelayed 0.6s ease-out 0.8s forwards;
}

@keyframes fadeInDelayed {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.action-btn {
  background: none;
  border: 1px solid #333;
  color: var(--icon);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--smooth-transition);
  transform: scale(1);
}

.action-btn:hover {
  background: #2a2a2a;
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 176, 0, 0.2);
}

.action-btn svg {
  width: 14px;
  height: 14px;
  transition: all var(--smooth-transition);
}

.followup-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  opacity: 0;
  animation: slideInStagger 0.8s ease-out 1s forwards;
}

.followup-chip {
  background: #222329;
  border: 1px solid #333;
  color: #feb000;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--smooth-transition);
  transform: scale(1);
  opacity: 0;
  animation: chipFadeIn 0.4s ease-out forwards;
}

.followup-chip:nth-child(1) { animation-delay: 0.1s; }
.followup-chip:nth-child(2) { animation-delay: 0.2s; }
.followup-chip:nth-child(3) { animation-delay: 0.3s; }
.followup-chip:nth-child(4) { animation-delay: 0.4s; }

@keyframes chipFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.followup-chip:hover {
  background: #2a2a2a;
  border-color: var(--primary);
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 4px 12px rgba(254, 176, 0, 0.15);
}

.suggestions-area {
  max-width: 640px; width: 96vw;
  margin: 0 auto; text-align: left;
  margin-bottom: 18px; font-size:0.98em;
  display: flex; flex-wrap: wrap; gap:8px;
  justify-content: flex-start;
  opacity: 1;
  pointer-events: auto;
  transition: all var(--smooth-transition);
}

.suggestion-chip {
  display: inline-block;
  font-family: var(--font-main);
  background: #222329;
  color: #feb000;
  border: 1.1px solid #feb00066;
  padding: 6px 15px 6px 11px;
  font-size: 12.8px;
  border-radius: 11px;
  margin: 0 10px 9px 0;
  cursor: pointer;
  transition: all var(--smooth-transition);
  user-select:none;
  transform: scale(1);
}

.suggestion-chip:hover { 
  background: #2c212a;
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 3px 8px rgba(254, 176, 0, 0.2);
}

.prompt-section {
  position: fixed; 
  left: var(--sidebar-width); 
  right: 0; 
  bottom: 0;
  width: auto; 
  z-index: 100;
  display: flex; 
  flex-direction: column; 
  align-items: center;
  background: var(--surface);
  padding: 20px 0;
  pointer-events: none;
  transition: all var(--bounce-transition);
}

.prompt-bar {
  background: #18191e;
  border: 1.7px solid var(--border);
  border-radius: var(--corner-radius);
  display: flex; 
  align-items: center; 
  gap: 5px;
  width: clamp(300px, 90vw, 620px);
  min-height: 48px;
  box-shadow: 0 4px 24px #191a223c;
  padding: 12px 16px;
  pointer-events: auto;
  margin: 0 auto;
  transition: all var(--bounce-transition);
  opacity: 1;
  transform: translateY(0) scale(1);
}

.prompt-centered {
  position: fixed !important;
  left: 0; 
  right: 0;
  bottom: 25vh;
  top: auto;
  z-index: 101;
  padding: 0;
  background: transparent;
}

.prompt-centered .prompt-bar {
  transform: scale(1.05);
  box-shadow: 
    0 8px 40px rgba(254, 176, 0, 0.15),
    0 0 0 1px rgba(254, 176, 0, 0.1);
  background: #191b23fa;
  backdrop-filter: blur(10px);
}

.prompt-bottom {
  position: fixed !important; 
  left: var(--sidebar-width); 
  right: 0;
  bottom: 0; 
  top: auto;
  z-index: 100;
  padding: 20px 0;
  background: var(--surface);
}

.prompt-bottom .prompt-bar {
  transform: none;
  background: #18191e;
  backdrop-filter: none;
}

.prompt-bar:focus-within { 
  border-color: var(--primary); 
  box-shadow: 
    0 2px 14px #feb00052,
    0 0 0 1px rgba(254, 176, 0, 0.3);
  transform: translateY(-2px);
}

.icon-btn {
  background:none; border:none; padding:0 2.7px;
  display:flex; align-items:center; 
  font-size:1.09em; color:var(--icon); 
  width:29px; height:29px;
  border-radius:6px;
  transition: all var(--smooth-transition);
  cursor:pointer;
  min-width:29px; min-height:29px;
  transform: scale(1);
}

.icon-btn:focus, .icon-btn:hover {
  color: var(--primary);
  background: #22232326;
  transform: scale(1.1);
}

.prompt-input {
  flex: 1 1 auto;
  border: none; background: transparent;
  resize: none;
  font-family: var(--font-main);
  font-size: 13.1px; color: #f3f3f7;
  padding: 8px 6px 7px 7px;
  outline: none;
  min-width: 0;
  line-height: 1.36;
  min-height: 28px; max-height: 90px;
  margin: 0 4px;
  transition: all var(--smooth-transition);
}

.prompt-loading {
  position: relative;
  border-color: var(--primary) !important;
  box-shadow: 0 0 24px #feb00091 !important;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

/* ====== PYTHON BACKEND CODE CONTAINER STYLES ====== */

/* Modern Code Container for Python-generated HTML */
.code-container {
  background: #22232a;
  border: 1.7px solid #353541;
  border-radius: 11px;
  margin: 22px 0;
  overflow: hidden;
  box-shadow: 0 3px 16px 0 rgb(0 0 0 / 11%);
}

.code-header {
  background: #1a1b21;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #353541;
}

.code-lang {
  color: #feb000;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.code-copy-btn {
  background: #2d2c37;
  color: #feb000;
  border: 1px solid #feb00044;
  border-radius: 6px;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.81;
  transition: opacity .18s, background .21s;
}

.code-copy-btn:hover {
  background: #38280a;
  opacity: 1;
}

.code-content {
  padding: 16px 20px;
  font-family: var(--font-mono), Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  background: #22232a;
  color: #e8eaf1;
}

.code-content code {
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

/* Inline code for single backticks */
.inline-code {
  background: #282828;
  color: #ffc107;
  border-radius: 4px;
  font-size: 0.97em;
  padding: 2px 7px;
  margin: 0 2px;
  font-family: var(--font-mono), monospace;
}

/* Enhanced response content styling */
.response-content h1, .response-content h2, .response-content h3 {
  color: #feb000;
  margin: 20px 0 12px 0;
}

.response-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.response-content li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.response-content p {
  margin: 12px 0;
  line-height: 1.6;
}

/* Remove user query code styling */
.user-query code {
  background: none !important;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

@keyframes loadingPulse {
  0%, 100% {
    border-color: #feb00085;
    box-shadow: 0 0 20px #feb00040;
  }
  50% {
    border-color: #feb000;
    box-shadow: 0 0 30px #feb00080;
  }
}

@media (max-width: 900px) {
  .sidebar{width:43px;}
  .prompt-section{left:43px;}
  .prompt-bottom{left:43px;}
  .auth-modal{right:20px; width:280px;}
}

@media (max-width: 600px) {
  .sidebar{display:none;}
  .prompt-section{left:0;}
  .prompt-bottom{left:0;}
  .auth-modal{right:15px; bottom:110px; width:260px;}
}
