codecraft-web-project-footer {
    display: none !important;
}

.welcome-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #0f172a;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.welcome-container {
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  position: relative;
}

.welcome-card {
  background: #ffffff;
  width: 100%;
  height: clamp(660px, 92vh, 900px); 
  aspect-ratio: 9 / 16;
  padding: 0;
  border-radius: 44px;
  border: 12px solid #334155;
  box-shadow: 
    0 50px 100px -20px rgba(3, 105, 161, 0.4), 
    0 20px 40px -10px rgba(0, 0, 0, 0.25),      
    inset 0 0 0 3px #cbd5e1;                 
  text-align: center;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden; 
  position: relative;
}

.app-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.app-brand {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 60%, #bae6fd 100%);
  width: 100%;
  padding: clamp(24px, 4.2vh, 40px) 24px clamp(20px, 3.2vh, 28px);
  border-bottom: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.app-brand h1 {
  font-size: clamp(1.6rem, 3.6vh, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0284c7;
  margin: 0;
}

.login-subtitle, .welcome-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 4px;
  margin-bottom: 0;
  font-weight: 500;
}

.visual-placeholder {
  width: 100%;
  flex-grow: 1;
  min-height: 160px;
  background: #ffffff; 
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  padding: 16px clamp(24px, 5vw, 40px);
  box-sizing: border-box;
}

.logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 clamp(24px, 5vw, 40px) clamp(28px, 4.5vh, 40px) clamp(24px, 5vw, 40px);
  background: #ffffff;
}

.btn {
  display: block;
  width: 100%;
  padding: clamp(14px, 2.4vh, 18px) 24px;
  border-radius: 16px;
  font-size: clamp(1.05rem, 2.2vh, 1.25rem);
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
  text-align: center;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: #0369a1;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #ffffff;
  color: #16a34a;
  border: 2px solid #bbf7d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  background: #f0fdf4;
  border-color: #86efac;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}

.form-container {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 10px clamp(24px, 5vw, 40px) 0 clamp(24px, 5vw, 40px);
  box-sizing: border-box;
  overflow-y: auto;
}

.login-icon-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 10px;
  width: 100%;
}

.login-user-icon {
  width: 54px;
  height: 54px;
  padding: 12px;
  background: #f0f9ff;
  color: #0284c7;
  border-radius: 50%;
  border: 2px solid #bae6fd;
}

.privacy-notice-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  box-sizing: border-box;
}

.privacy-notice-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 2px;
}

.privacy-notice-text {
  font-size: 0.75rem;
  color: #166534;
  margin: 0;
  line-height: 1.3;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: #0284c7;
  background: #ffffff;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 2px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.login-divider span {
  padding: 0 10px;
}

.btn-back-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  width: 100%;
  text-align: center;
}

.dashboard-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 60%, #bae6fd 100%);
  width: 100%;
  padding: 20px 24px;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.dashboard-header h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0284c7;
  margin: 0;
}

.logout-btn-sm {
  width: auto !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  border-radius: 10px !important;
  min-height: auto !important;
}

.dashboard-content {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  box-sizing: border-box;
  overflow-y: auto;
  text-align: left;
  gap: 12px;
  background: #ffffff;
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 12px;
  gap: 8px;
  color: #64748b;
}

.global-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  font-family: inherit;
  color: #0f172a;
}

.welcome-greeting-card {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-radius: 20px;
  padding: 16px;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.greeting-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #f0f9ff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
  text-transform: uppercase;
}

.welcome-greeting-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
}

.welcome-greeting-card p {
  font-size: 0.8rem;
  margin: 0;
  color: #e0f2fe;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0;
}

.progress-bar-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0 0 0;
}

.info-banner-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-banner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.info-banner-text {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  box-sizing: border-box;
  transition: all 0.2s ease;
  cursor: pointer;
}

.module-card:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.module-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bookmark-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.bookmark-btn:hover {
  color: #0284c7;
  transform: scale(1.1);
}

.bookmark-btn.bookmarked {
  color: #0284c7; /* Matches your primary theme blue */
}

.bookmark-btn.bookmarked svg {
  fill: #0284c7; /* Fills the icon solidly with your theme blue when saved */
}

.writing-icon { background: #dcfce7; color: #16a34a; }
.math-icon { background: #e0f2fe; color: #0284c7; }
.library-icon { background: #fef3c7; color: #d97706; }

.module-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.module-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.bottom-nav {
  width: 100%;
  border-top: 1px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  padding: 10px 12px;
  box-sizing: border-box;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 4px;
  flex: 1;
  color: #64748b;
}

.nav-item.active {
  color: #0284c7;
}

.nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
}

/* LESSON VIEW STYLES */
#lesson-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #ffffff;
  overflow: hidden;
}

.lesson-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  text-align: left;
}

.back-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 4px;
}

.back-btn:hover {
  color: #0284c7;
}

.quiz-question {
  font-weight: 700 !important;
  color: #0f172a !important;
}

.lesson-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.lesson-option {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.lesson-option:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.lesson-option.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.lesson-feedback-text {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.lesson-feedback-text:not(:empty) {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  box-sizing: border-box;
}

/* FLOATING CHAT WIDGET (MOVED HIGHER TO CLEAR NAV BAR) */
#chat-widget-container {
  position: absolute;
  bottom: 110px; /* Shifted higher up */
  right: 20px;
  z-index: 100;
}

#chat-toggle-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 10px 16px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

#chat-toggle-btn:hover {
  background: #0369a1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

#chat-window {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 280px;
  height: 360px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  overflow: hidden;
  text-align: left;
}

.chat-header {
  background: #0284c7;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#close-chat-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

.chat-messages {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}

.chat-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.chat-bubble.bot {
  background: #e2e8f0;
  color: #0f172a;
  align-self: flex-start;
}

.chat-bubble.user {
  background: #0284c7;
  color: #ffffff;
  align-self: flex-end;
}

.chat-input-area {
  display: flex;
  padding: 8px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  gap: 6px;
}

.chat-input-area input {
  flex-grow: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  outline: none;
}

.chat-input-area button {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* ACCESSIBILITY VIEW / SETTING UTILITIES */
.welcome-card.text-scale-large {
  font-size: 1.1rem;
}
.welcome-card.text-scale-large h1 { font-size: 1.5rem; }
.welcome-card.text-scale-large h3 { font-size: 1.2rem; }

.welcome-card.text-scale-xlarge {
  font-size: 1.2rem;
}
.welcome-card.text-scale-xlarge h1 { font-size: 1.7rem; }
.welcome-card.text-scale-xlarge h3 { font-size: 1.35rem; }

.welcome-card.focus-mode-active .info-banner-card,
.welcome-card.focus-mode-active .greeting-badge {
  display: none !important;
}