/* ============================================================
   IKARAL SUPPORT — Apple-inspired Light Professional Theme
   CSS Variables untuk kustomisasi mudah
   ============================================================ */

:root {
  /* ---- Color Palette ---- */
  --bg-primary: #f5f5f7;
  --bg-secondary: rgba(255, 255, 255, 0.88);
  --bg-tertiary: #ffffff;
  --bg-sidebar: #fbfbfd;
  --bg-sidebar-hover: #f0f0f2;
  --bg-input: #ffffff;
  --bg-bubble-bot: #ffffff;
  --bg-bubble-user: #e8f2ff;
  --bg-code: #f2f4f7;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.13);

  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #6e6e73;
  --text-dim: #86868b;

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-glow: rgba(0, 113, 227, 0.16);
  --accent-subtle: rgba(0, 113, 227, 0.08);

  --success: #248a3d;
  --warning: #b25000;
  --error: #d70015;
  --error-bg: rgba(215, 0, 21, 0.07);

  /* ---- Layout ---- */
  --sidebar-width: 280px;
  --header-height: 60px;
  --input-height: auto;
  --border-radius: 18px;
  --border-radius-sm: 12px;
  --border-radius-lg: 24px;

  /* ---- Typography ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* ---- Transitions ---- */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), min-width var(--transition-normal);
  z-index: 10;
  box-shadow: 1px 0 0 rgba(255,255,255,.75);
}

#sidebar.collapsed {
  transform: translateX(calc(var(--sidebar-width) * -1));
  min-width: 0;
  width: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2997ff, #0066cc);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 750;
  box-shadow: 0 6px 18px rgba(0,113,227,.22);
}

.logo-text {
  font-size: 17px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-highlight {
  color: var(--accent);
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 11px 14px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-new-chat:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,113,227,.2);
  transform: translateY(-1px);
}

/* Sidebar History */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.history-item {
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.history-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.history-item.active {
  background: #e8f2ff;
  border-color: rgba(0,113,227,.16);
  color: #005fbf;
  font-weight: 600;
}

.history-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 16px;
  line-height: 1.6;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.status-dot.error {
  background: var(--error);
  box-shadow: 0 0 6px var(--error);
}

.status-dot.loading {
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.status-text {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-clear {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear:hover {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

button:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(0, 113, 227, .28);
  outline-offset: 2px;
}

/* ============================================================
   MAIN CHAT AREA
   ============================================================ */
#main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: #f5f5f7;
  color: var(--accent);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.chat-title h1 {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.3;
}

.chat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ============================================================
   MESSAGES CONTAINER
   ============================================================ */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px clamp(16px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Message Wrapper */
.message-wrapper {
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.3s ease both;
}

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

/* Bot Message */
.message-bot,
.message-user {
  display: flex;
  gap: 12px;
  max-width: min(85%, 780px);
}

.message-bot {
  align-self: flex-start;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #fff;
  border: 1px solid var(--border-color);
  line-height: 1;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  line-height: 1.65;
  font-size: 14.5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message-bot .message-bubble {
  background: var(--bg-bubble-bot);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.message-user .message-bubble {
  background: var(--bg-bubble-user);
  border: 1px solid var(--border-light);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Markdown dalam bubble */
.message-bubble p {
  margin-bottom: 8px;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  color: var(--accent);
  font-weight: 600;
}

.message-bubble em {
  color: var(--text-secondary);
}

.message-bubble code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-hover);
  border: 1px solid var(--border-color);
}

.message-bubble pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 10px 0;
}

.message-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
}

.message-bubble ul,
.message-bubble ol {
  margin-left: 20px;
  margin-bottom: 8px;
}

.message-bubble li {
  margin-bottom: 4px;
}

.message-bubble a {
  color: var(--accent);
  text-decoration: none;
}
.message-bubble a:hover {
  text-decoration: underline;
}

.message-bubble blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.message-bubble hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 12px 0;
}

.message-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
.message-bubble th,
.message-bubble td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}
.message-bubble th {
  background: var(--bg-code);
  color: var(--accent);
  font-weight: 600;
}

/* Message Timestamp */
.message-time {
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 4px;
}

.message-user .message-time {
  text-align: right;
}

/* Welcome Section */
.message-wrapper.welcome .message-bubble {
  background: linear-gradient(145deg, #ffffff 10%, #edf6ff 100%);
  border-color: rgba(0,113,227,.2);
  border-width: 1px;
}

.welcome-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px 16px;
}

.board-loader { position: relative; width: 62px; height: 40px; border: 1px solid rgba(0,113,227,.25); border-radius: 12px; background: repeating-linear-gradient(90deg, #fff 0 9px, rgba(0,113,227,.07) 10px 11px); overflow: hidden; box-shadow:var(--shadow-sm); }
.board-chip { position: absolute; inset: 9px 18px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; border-radius: 4px; box-shadow: 0 0 14px rgba(0,113,227,.35); }
.board-loader i { position: absolute; height: 1px; width: 18px; background: var(--accent); animation: circuitPulse 1.4s infinite; }
.board-loader i:nth-of-type(1) { top: 8px; left: 0; }.board-loader i:nth-of-type(2) { top: 30px; right: 0; animation-delay:.3s }.board-loader i:nth-of-type(3) { width:1px;height:10px;left:11px;bottom:0;animation-delay:.6s }.board-loader i:nth-of-type(4) { width:1px;height:10px;right:11px;top:0;animation-delay:.9s }
.typing-status { color: var(--text-muted); font-size: 12px; }
@keyframes circuitPulse { 0%,100%{opacity:.15} 50%{opacity:1;box-shadow:0 0 8px var(--accent)} }

.typing-indicator.hidden {
  display: none;
}

.typing-indicator .message-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 16px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-bubble-bot);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  border-bottom-left-radius: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   INPUT AREA
   ============================================================ */
.input-area {
  padding: 12px clamp(16px, 5vw, 72px) 18px;
  border-top: 0;
  background: linear-gradient(to top, #f5f5f7 72%, rgba(245,245,247,0));
}

.attachment-preview { display:flex; gap:8px; flex-wrap:wrap; padding: 8px clamp(16px, 5vw, 72px); background:transparent; }
.attachment-preview.hidden,.upload-menu.hidden { display:none; }
.attachment-chip { display:flex; align-items:center; gap:8px; max-width:260px; padding:7px 10px; border:1px solid var(--border-light); background:var(--bg-tertiary); border-radius:8px; font-size:12px; }
.attachment-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment-chip button { border:0;background:transparent;color:var(--error);cursor:pointer;font-size:18px; }
.upload-menu { position:fixed; left:calc(var(--sidebar-width) + 72px); bottom:98px; z-index:80; display:flex; flex-direction:column; min-width:220px; padding:8px; background:rgba(255,255,255,.94); -webkit-backdrop-filter:blur(24px); backdrop-filter:blur(24px); border:1px solid var(--border-color); border-radius:16px; box-shadow:var(--shadow-lg); }
.upload-menu button { text-align:left; border:0; background:transparent; color:var(--text-primary); padding:10px; border-radius:7px; cursor:pointer; }.upload-menu button:hover{background:var(--accent-subtle);color:var(--accent)}
.btn-composer { height:38px; min-width:38px; padding:0 10px; border:1px solid var(--border-color); border-radius:12px; background:#f5f5f7; color:var(--text-secondary); cursor:pointer; font-weight:650; transition:all var(--transition-fast); }.btn-composer:hover{color:var(--accent);border-color:rgba(0,113,227,.25);background:#edf6ff;transform:translateY(-1px)}
.message-actions { display:flex; gap:6px; margin-top:4px; flex-wrap:wrap; }.message-actions button { border:1px solid var(--border-color); border-radius:10px; padding:6px 10px; background:#fff; color:var(--text-muted); font-family:var(--font-sans); font-size:11px; font-weight:550; cursor:pointer; box-shadow:var(--shadow-sm); transition:all var(--transition-fast); }.message-actions button:hover{color:var(--accent);border-color:rgba(0,113,227,.25);background:#f5f9ff;transform:translateY(-1px)}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 9px 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 10px 35px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 14px 40px rgba(0,0,0,.09);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 160px;
  min-height: 24px;
  padding: 4px 0;
}

#chat-input::placeholder {
  color: var(--text-dim);
}

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-send:disabled {
  background: #e5e5ea;
  color: #a1a1a6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-send:disabled:hover {
  background: #e5e5ea;
  box-shadow: none;
  transform: none;
}

.input-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ============================================================
   TOAST / SNACKBAR
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 10px 24px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  transition: all var(--transition-normal);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

.toast.info {
  background: rgba(255,255,255,.95);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.toast.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}

.toast.success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
  }

  #sidebar.collapsed {
    transform: translateX(-100%);
  }

  .message-bot,
  .message-user {
    max-width: 95%;
  }

  .messages-container {
    padding: 16px 12px;
  }

  .chat-header {
    padding: 0 12px;
  }

  .input-area {
    padding: 10px 12px 14px;
  }
  .upload-menu { left:12px; bottom:92px; }
}

@media (max-width: 480px) {
  .chat-subtitle {
    display: none;
  }

  .logo-text {
    font-size: 15px;
  }

  .input-footer { display: none; }
  .input-wrapper { gap: 7px; padding: 8px; }
  .btn-composer { min-width: 36px; padding: 0 8px; }
  .message-avatar { width: 30px; height: 30px; min-width: 30px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   STREAMING CURSOR (opsional, untuk efek mengetik)
   ============================================================ */
.streaming-cursor::after {
  content: "▊";
  animation: blink 1s step-end infinite;
  color: var(--accent);
  margin-left: 1px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
/* ============================================================ */
/* LOGIN OVERLAY */
/* ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
  animation: slideUp 0.5s ease;
}

.login-logo { margin-bottom: 16px; }

.login-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  color: #1a1a2e;
}

.login-subtitle {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6366f1;
  font-weight: 600;
}

.login-desc {
  margin: 0 0 24px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.input-group {
  text-align: left;
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.input-group input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
  text-align: left;
}

.login-error.hidden { display: none; }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-login:active { transform: scale(0.98); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner.hidden { display: none; }

.login-footer {
  margin: 20px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

/* Sidebar user display */
.sidebar-user {
  padding: 6px 10px;
  font-size: 12px;
  color: #6366f1;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Logout button */
#btn-logout { margin-top: 4px; }

/* Sidebar footer buttons row */
.sidebar-footer {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hidden class for main elements */
.hidden { display: none !important; }
