@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   Design System Variables & Resets
   ========================================================================== */
:root {
  --font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --primary-color: #ff9f43;     /* Warm Amber/Light */
  --primary-light: #ffb875;
  --primary-dark: #e67e22;
  --secondary-color: #4a90e2;   /* Sky Blue */
  --secondary-light: #70a1ff;
  --secondary-dark: #2f3542;
  
  --bg-gradient-start: #f1f5f9;
  --bg-gradient-end: #e2e8f0;
  
  --text-main: #2c3e50;
  --text-muted: #7f8c8d;
  --text-light: #ffffff;
  
  --success-color: #2ecc71;
  --error-color: #e74c3c;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: rgba(31, 38, 135, 0.08);
  --sidebar-bg: rgba(255, 255, 255, 0.45);
  
  /* Borders and Transitions */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.5s ease;
}

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

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Glowing Blobs for Rich Aesthetics */
.bg-blobs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background-color: var(--primary-color);
  animation-duration: 25s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 45vw;
  height: 45vw;
  background-color: var(--secondary-color);
  animation-duration: 18s;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 50%;
  width: 30vw;
  height: 30vw;
  background-color: #ff7675;
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(50px, 30px) scale(1.1) rotate(180deg); }
  100% { transform: translate(-30px, -50px) scale(0.95) rotate(360deg); }
}

/* ==========================================================================
   App Container (Main Layout)
   ========================================================================== */
.app-container {
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  max-height: 100%;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  z-index: 10;
  overflow: hidden;
  transition: var(--transition-normal);
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.sidebar-logo img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(255, 159, 67, 0.3);
  border: 2px solid #fff;
  animation: logo-bounce 3s infinite ease-in-out;
}

@keyframes logo-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.sidebar-logo h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(45deg, var(--primary-dark), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  transition: var(--transition-fast);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--secondary-color);
  transform: translateX(4px);
}

.nav-link:hover svg {
  stroke: var(--secondary-color);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--text-light);
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link.active svg {
  stroke: var(--text-light);
}

.sidebar-footer {
  margin-top: auto;
  padding: 15px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-footer .school-info {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.sidebar-footer .version {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
}

/* Header Area */
.app-header {
  height: 80px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  flex-shrink: 0;
}

.header-title-area h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  display: inline-block;
  box-shadow: 0 0 8px var(--success-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Content Container & Scrollable Areas */
.content-body {
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Tab View Switcher (Hidden by default unless active) */
.view-panel {
  display: none;
  animation: fadeInUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
  min-height: 0;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

#view-dashboard,
#view-digital-portal {
  overflow-y: auto;
  min-height: 0;
  padding-right: 5px; /* prevent layout shifts on scrollbar appearance */
}

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

/* ==========================================================================
   Common Components (Cards, Forms, Buttons)
   ========================================================================== */
.card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
  transition: var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Split Pane Layout (Input left, output right) */
.split-view {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.split-view > .card {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .split-view {
    grid-template-columns: 1fr;
  }
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.6);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.2);
}

/* Result Container Styles */
.result-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 15px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.result-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-body {
  flex-grow: 1;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  height: 100%;
  text-align: center;
  gap: 15px;
  padding: 40px;
}

.result-placeholder svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.6;
}

.result-content {
  display: none;
  animation: fadeIn 0.4s ease;
  height: 100%;
}

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

/* Copy Confirmation Popover */
.copy-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  width: auto;
  background: rgba(74, 144, 226, 0.1);
  color: var(--secondary-color);
  border: 1px solid rgba(74, 144, 226, 0.2);
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--secondary-color);
  color: #fff;
}

.copy-btn.copied {
  background: var(--success-color);
  color: #fff;
  border-color: var(--success-color);
}

/* AI Loading Spinner Overlay */
.ai-loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  border-radius: var(--radius-md);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 15px;
  animation: fadeIn 0.2s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 159, 67, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   View-Specific Styling
   ========================================================================== */

/* 1. Dashboard View */
.welcome-section-premium {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
}

.welcome-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.school-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 20px;
  border-radius: 50px;
  width: fit-content;
  border: 1.5px solid rgba(74, 144, 226, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.school-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.school-text-group h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary-dark);
}

.school-motto {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0 !important;
}

.welcome-message h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary-dark);
}

.welcome-message p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.welcome-mascots {
  display: flex;
  gap: 25px;
  align-items: flex-end;
  flex-shrink: 0;
}

.mascot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mascot-img {
  height: 125px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.08));
}

.girl-mascot .mascot-img {
  animation: mascot-float-girl 4s infinite alternate ease-in-out;
}

.boy-mascot .mascot-img {
  animation: mascot-float-boy 4s infinite alternate ease-in-out -2s;
}

@keyframes mascot-float-girl {
  0% { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes mascot-float-boy {
  0% { transform: translateY(0) rotate(1deg); }
  100% { transform: translateY(-8px) rotate(-1deg); }
}

.mascot-label {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.mascot-label.girl {
  background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
}

.mascot-label.boy {
  background: linear-gradient(135deg, #1dd1a1 0%, #10ac84 100%);
}

/* Responsive handling for mascots */
@media (max-width: 950px) {
  .welcome-section-premium {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .welcome-mascots {
    justify-content: center;
    margin-top: 10px;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 144, 226, 0.1);
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--secondary-color);
  fill: none;
  stroke-width: 2;
}

.stat-card:nth-child(2) .stat-icon {
  background: rgba(255, 159, 67, 0.1);
}
.stat-card:nth-child(2) .stat-icon svg {
  stroke: var(--primary-color);
}

.stat-card:nth-child(3) .stat-icon {
  background: rgba(46, 204, 113, 0.1);
}
.stat-card:nth-child(3) .stat-icon svg {
  stroke: var(--success-color);
}

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-info span {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

.dashboard-news h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-main);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--secondary-color);
}

.news-item.warning {
  border-left-color: var(--primary-color);
}

.news-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 2. Chat View */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-header {
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.chat-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
}

.chat-mode-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--secondary-color);
}

.chat-settings-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-settings-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.15);
}

.chat-settings-panel {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  animation: fadeInDown 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chat-settings-panel h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.chat-settings-panel p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.settings-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.settings-actions {
  display: flex;
  gap: 8px;
}

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

.chat-messages {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 95%;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

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

.message.received .message-bubble {
  background: #ffffff;
  border-top-left-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.message.sent .message-bubble {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #357abd 100%);
  color: #fff;
  border-top-right-radius: 0;
}

.chat-chips {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
}

.chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.chat-input-area {
  padding: 18px 24px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.chat-input-area textarea {
  flex-grow: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  resize: none;
  height: 48px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.chat-input-area textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--secondary-color);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--secondary-dark);
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  transform: rotate(45deg);
}

/* Beautiful custom markdown layouts inside outputs */
.preview-document {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
  height: 100%;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-document h1,
.preview-document h2,
.preview-document h3 {
  color: var(--secondary-dark);
  margin-top: 20px;
  margin-bottom: 10px;
}

.preview-document h1:first-child,
.preview-document h2:first-child {
  margin-top: 0;
}

.preview-document h2 {
  font-size: 1.15rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 5px;
}

.preview-document h3 {
  font-size: 1rem;
}

.preview-document p {
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: #34495e;
}

.preview-document ul,
.preview-document ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.preview-document li {
  margin-bottom: 5px;
}

.preview-document blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 10px 15px;
  background: rgba(255, 159, 67, 0.05);
  margin-bottom: 15px;
  font-style: italic;
}

.preview-document table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.preview-document th,
.preview-document td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  text-align: left;
}

.preview-document th {
  background-color: rgba(74, 144, 226, 0.05);
  font-weight: 600;
}

/* Tone Selection Pills */
.tone-selector {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.tone-pill {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tone-pill:hover {
  background: rgba(255, 255, 255, 0.9);
}

.tone-pill.active {
  background: rgba(74, 144, 226, 0.15);
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  font-weight: 600;
}

/* Chatbot Markdown Renders styling */
.bullet-item {
  margin: 6px 0;
  padding-left: 5px;
  line-height: 1.6;
}

.chat-section-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin: 16px 0 8px 0;
  border-bottom: 2px solid rgba(74, 144, 226, 0.15);
  padding-bottom: 4px;
}

.chat-link {
  color: var(--secondary-color);
  text-decoration: underline;
  font-weight: 500;
}

.chat-link:hover {
  color: #357abd;
}

/* ==========================================================================
   Mobile Responsive Sidebar and Hamburger Menu
   ========================================================================== */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.hamburger-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header-title-area {
  display: flex;
  align-items: center;
}

.sidebar-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }

  .hamburger-btn {
    display: flex !important;
  }
  
  .app-header {
    padding: 0 15px;
  }
  
  .content-body {
    padding: 15px;
  }
  
  .main-content {
    width: 100vw;
  }

  .app-header h2 {
    font-size: 1.15rem;
  }

  .header-meta {
    gap: 10px;
  }

  .meta-item span {
    font-size: 0.75rem;
  }

  /* Other mobile adjustments for dashboard and leave-letter views */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .welcome-section-premium {
    padding: 20px;
  }

  .welcome-section-premium h2 {
    font-size: 1.5rem;
  }

  .welcome-mascots {
    gap: 15px;
  }

  .mascot-card img {
    width: 100px;
  }
}
