/* ==========================================================================
   AI School OS - Main Stylesheet
   Design System: Apple Cleanliness + Google Material Design
   Primary Font: Poppins
   ========================================================================== */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --secondary: #14B8A6;
  --secondary-hover: #0D9488;
  --secondary-light: #CCFBF1;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;
  --bg-main: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --success: #22C55E;
  --success-light: #DCFCE7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.09);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.15);

  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

p, span, label {
  color: var(--text-main);
}

/* Navbar & Header */
.app-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.75rem 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.nav-link-custom {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link-custom:hover, .nav-link-custom.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

/* Language Selector Dropdown */
.lang-selector {
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.lang-selector:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Sidebar Layout */
.dashboard-wrapper {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 65px);
}

.app-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.sidebar-item a i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  padding: 2rem;
  background-color: var(--bg-main);
  overflow-y: auto;
}

/* Cards & UI Components */
.card-custom {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
  box-shadow: var(--shadow-md);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.teal { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.amber { background: var(--accent-light); color: var(--accent); }
.stat-icon.green { background: var(--success-light); color: var(--success); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Custom Buttons */
.btn-primary-custom {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-secondary-custom {
  background-color: var(--secondary);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  transition: all 0.2s ease;
}

.btn-secondary-custom:hover {
  background-color: var(--secondary-hover);
  color: white;
}

.btn-outline-custom {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-outline-custom:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

/* Badges */
.badge-custom {
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-teal { background: var(--secondary-light); color: var(--secondary); }
.badge-amber { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: var(--success); }

/* Progress Bar */
.progress-custom {
  height: 8px;
  background-color: var(--border-color);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar-custom {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 50px;
  transition: width 0.4s ease;
}

/* Chat UI Styles */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-header {
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--bg-main);
}

.chat-message {
  display: flex;
  gap: 1rem;
  max-width: 80%;
}

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

.chat-message.ai {
  align-self: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-message.user .message-avatar {
  background: var(--primary);
  color: white;
}

.chat-message.ai .message-avatar {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.925rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.chat-message.user .message-bubble {
  background: var(--primary);
  color: white;
  border-top-right-radius: 2px;
}

.chat-message.ai .message-bubble {
  background: white;
  color: var(--text-main);
  border-top-left-radius: 2px;
  border: 1px solid var(--border-color);
}

.chat-input-area {
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-main);
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chat-input-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 0.925rem;
}

.btn-send-chat {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-send-chat:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* Footer */
.app-footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--text-muted);
}
