/* ========== CSS VARIABLES ========== */
:root {
  --bg-primary: #f0f4f8;
  --text-primary: #1a2a3a;
  --text-secondary: #4a5b6e;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #3b82f6;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.4);
  --card-bg: rgba(255, 255, 255, 0.85);
  --neumo-shadow: 8px 8px 16px rgba(0,0,0,0.05), -8px -8px 16px rgba(255,255,255,0.7);
  --transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background with Hero Image */
.app-container {
  position: relative;
  min-height: 100vh;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}
.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(240, 244, 248, 0.85);
  backdrop-filter: blur(2px);
  z-index: 0;
}

/* Floating Chat Button (mobile only) */
.floating-chat-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}
.floating-chat-btn:hover {
  transform: scale(1.05);
  background: var(--accent-dark);
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 20px;
}

/* Main Dashboard Layout */
.chat-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* Glass Card Base */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--neumo-shadow);
  transition: var(--transition);
}

/* Sidebar, Chat Main, Right Panel Styles (kept from previous) */
.chat-sidebar { display: flex; flex-direction: column; padding: 1.5rem; height: calc(100vh - 2rem); position: sticky; top: 1rem; }
.sidebar-header { text-align: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--glass-border); }
.bot-avatar-large img { width: 60px; height: 60px; border-radius: 30px; }
.status { font-size: 0.8rem; color: var(--text-secondary); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: #10b981; margin-right: 6px; }
.conversation-history { flex: 1; overflow-y: auto; }
.history-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border-radius: 16px; cursor: pointer; }
.history-item:hover { background: var(--glass-bg); }
.history-item.active { background: var(--glass-bg); border-left: 3px solid var(--accent); }
.new-chat-btn { width: 100%; padding: 0.8rem; border-radius: 40px; background: var(--accent); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1rem; }

.chat-main { display: flex; flex-direction: column; height: calc(100vh - 2rem); position: sticky; top: 1rem; }
.chat-main-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--glass-border); }
.header-info { display: flex; align-items: center; gap: 0.8rem; }
.header-actions { display: flex; gap: 0.8rem; align-items: center; }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); padding: 0.4rem; border-radius: 50%; transition: var(--transition); }
.icon-btn:hover { color: var(--accent); }
.language-selector { display: flex; gap: 0.3rem; background: var(--glass-bg); border-radius: 40px; padding: 0.2rem; }
.lang-option { padding: 0.3rem 0.8rem; border-radius: 30px; border: none; background: none; cursor: pointer; font-weight: 500; }
.lang-option.active { background: var(--accent); color: white; }
.slow-mode-active { color: var(--accent); text-shadow: 0 0 4px var(--accent); }

.chat-messages-container { flex: 1; overflow-y: auto; padding: 1rem; }
.message { display: flex; gap: 0.8rem; align-items: flex-start; margin-bottom: 1rem; }
.message.bot .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); overflow: hidden; flex-shrink: 0; }
.message.user { flex-direction: row-reverse; }
.message.user .bubble { background: var(--accent); color: white; border-radius: 24px 24px 4px 24px; }
.bubble { background: var(--glass-bg); backdrop-filter: blur(4px); padding: 10px 16px; border-radius: 24px 24px 24px 4px; max-width: 80%; word-wrap: break-word; }
.ai-badge { font-size: 0.65rem; color: var(--text-secondary); margin-top: 0.5rem; display: flex; align-items: center; gap: 0.3rem; }

.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--text-secondary); animation: typing 1.4s infinite; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.suggestions-panel { padding: 0.8rem 1rem; border-top: 1px solid var(--glass-border); background: var(--glass-bg); }
.suggestions-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.suggestion-chip { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 6px 14px; border-radius: 40px; font-size: 0.8rem; cursor: pointer; transition: var(--transition); }
.suggestion-chip:hover { background: var(--accent); color: white; }

.chat-input-area { display: flex; align-items: center; gap: 0.5rem; padding: 1rem; border-top: 1px solid var(--glass-border); }
.input-actions { display: flex; gap: 0.5rem; }
.action-btn { background: var(--glass-bg); border: 1px solid var(--glass-border); width: 40px; height: 40px; border-radius: 40px; cursor: pointer; transition: var(--transition); }
.action-btn:hover { background: var(--accent); color: white; }
#chatInput { flex: 1; padding: 12px 18px; border-radius: 60px; border: 1px solid var(--glass-border); background: var(--bg-primary); color: var(--text-primary); font-family: inherit; }
.send-btn { background: var(--accent); border: none; width: 44px; height: 44px; border-radius: 44px; cursor: pointer; color: white; transition: var(--transition); }
.send-btn:hover { transform: scale(1.05); background: var(--accent-dark); }
.chat-footer-note { text-align: center; font-size: 0.7rem; color: var(--text-secondary); padding: 0.5rem; border-top: 1px solid var(--glass-border); }

.chat-right-panel { display: flex; flex-direction: column; gap: 1rem; height: calc(100vh - 2rem); overflow-y: auto; position: sticky; top: 1rem; }
.info-card { padding: 1.2rem; }
.info-card h3 { font-size: 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }

.course-list { display: flex; flex-direction: column; gap: 0.8rem; }
.course-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem; background: var(--glass-bg); border-radius: 20px; }
.course-row img { width: 40px; height: 40px; border-radius: 12px; }
.course-info { flex: 1; }
.quick-ask { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; cursor: pointer; transition: var(--transition); }
.quick-ask:hover { background: var(--accent); color: white; }

.eligibility-form, .appointment-form { display: flex; flex-direction: column; gap: 0.6rem; }
.eligibility-form select, .eligibility-form input, .appointment-form input, .appointment-form select, .appointment-form textarea { padding: 8px 12px; border-radius: 40px; border: 1px solid var(--glass-border); background: var(--bg-primary); }
.btn-neumo { background: var(--accent); border: none; padding: 10px; border-radius: 40px; color: white; font-weight: 600; cursor: pointer; box-shadow: var(--neumo-shadow); transition: var(--transition); }
.btn-neumo:hover { transform: scale(1.02); background: var(--accent-dark); }
.btn-outline { background: none; border: 1px solid var(--accent); padding: 8px; border-radius: 40px; color: var(--accent); cursor: pointer; font-weight: 500; transition: var(--transition); }
.btn-outline:hover { background: var(--accent); color: white; }

.eligibility-result { margin-top: 0.8rem; padding: 0.6rem; border-radius: 16px; font-size: 0.8rem; background: rgba(37,99,235,0.1); text-align: center; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { max-width: 800px; width: 90%; max-height: 80vh; overflow-y: auto; padding: 1.5rem; }
.modal-close { float: right; font-size: 1.8rem; cursor: pointer; color: var(--text-secondary); }
.admin-tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.admin-tab { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 6px 16px; border-radius: 40px; cursor: pointer; }
.admin-tab.active { background: var(--accent); color: white; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.admin-table th, .admin-table td { border: 1px solid var(--glass-border); padding: 0.5rem; text-align: left; }
.admin-table th { background: var(--glass-bg); }

/* Footer */
.glass-footer { text-align: center; padding: 1.5rem; margin-top: 2rem; background: var(--glass-bg); backdrop-filter: blur(8px); border-radius: 32px; width: 95%; margin-left: auto; margin-right: auto; position: relative; z-index: 1; }

/* Responsive */
@media (max-width: 1024px) {
  .chat-sidebar { display: none; }
  .chat-dashboard { grid-template-columns: 1fr 320px; }
  .floating-chat-btn { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 768px) {
  .chat-dashboard { grid-template-columns: 1fr; }
  .chat-right-panel { display: none; }
  .chat-main { height: calc(100vh - 2rem); }
}