/* ═══════════════════════════════════════════════════════════════
   DK_PROD ACADEMY - CABINET STYLES (UNIFIED 2026)
   Matches index.html 1:1 on visual language
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────── LAYOUT ROOT ──────────────── */
.cabinet-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ──────────────── SIDEBAR (Premium Glass) ──────────────── */
.sidebar {
  width: 280px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 1px solid var(--border-subtle);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.sidebar-header {
  padding: var(--space-4) var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  height: 72px; /* Fixed height to match index nav */
  display: flex; /* Ensure centering */
  align-items: center; /* Vertical center */
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

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

.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out-expo);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i,
.nav-item span.material-icons {
  font-size: 20px;
  color: var(--text-tertiary);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--gradient-lime-cyan);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-lime);
}

.nav-item.active i,
.nav-item.active span.material-icons {
  color: var(--bg-primary);
}

.sidebar-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────── MAIN CONTENT ──────────────── */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: var(--space-8); /* Reduced padding */
  max-width: 1400px;
  position: relative;
  min-height: 100vh;
}

.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.mb-xl {
  margin-bottom: 96px !important; /* Force large gap */
}

.mb-2xl {
  margin-bottom: 128px !important;
}

.page-header {
  margin-bottom: var(--space-12);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

/* ──────────────── SECTIONS ──────────────── */
.section {
  display: none;
  animation: fadeIn 0.5s var(--ease-out-expo) forwards;
}

.section.active {
  display: block;
}

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

/* ──────────────── COMPONENTS (Sync with Landing) ──────────────── */
/* 3D Glass Cards (Refined to match main pricing) */
.card-3d {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.card-3d:hover {
  transform: translateY(-10px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-xl), var(--shadow-glow-lime);
}

.card-3d::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-lime-cyan);
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-out-expo);
  transform-origin: left;
}

.card-3d:hover::before {
  transform: scaleX(1);
}

/* ──────────────── CALENDAR (Interactive & Premium) ──────────────── */
.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  backdrop-filter: blur(20px);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2); /* Reduced gap */
}

.calendar-day-label {
  text-align: center;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: var(--space-4) 0;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
}

.calendar-day {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Darker border */
  border-radius: var(--radius-lg);
  padding: 8px; /* Fixed small padding */
  position: relative;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 80px; /* Reduced min-height */
  color: var(--text-secondary);
  overflow: hidden; /* Prevent overflow */
  word-wrap: break-word;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.calendar-day.today {
  border: 2px solid var(--color-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.calendar-day.has-lesson {
  background: rgba(204, 255, 0, 0.1);
  border-color: rgba(204, 255, 0, 0.3);
  color: var(--color-lime);
}

.calendar-day.has-note {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.calendar-day.has-alert {
  background: rgba(255, 0, 110, 0.1);
  border-color: rgba(255, 0, 110, 0.3);
}

.calendar-day.selected {
  background: var(--color-lime) !important;
  color: #000 !important;
  border-color: var(--color-lime);
  box-shadow: 0 0 20px rgba(204, 255, 0, 0.3);
}

.calendar-day.disabled {
  opacity: 0.2;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: transparent;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  transform: translateY(-4px) scale(1.02);
  z-index: 2;
  box-shadow: var(--shadow-lg);
}

.calendar-day.today {
  border-color: var(--color-lime);
  background: rgba(var(--color-lime-rgb), 0.05);
  box-shadow: inset 0 0 15px rgba(var(--color-lime-rgb), 0.1);
}

.calendar-day.today .day-number {
  color: var(--color-lime);
  font-weight: 800;
}

.calendar-day.other-month {
  opacity: 0.3;
  pointer-events: none;
}

.day-number {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: auto;
}

.day-indicators {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.indicator.busy {
  background: var(--color-lime);
  box-shadow: 0 0 8px var(--color-lime);
}
.indicator.note {
  background: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan);
}
.indicator.alert {
  background: var(--color-pink);
  box-shadow: 0 0 8px var(--color-pink);
}

.calendar-slot-info {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TV Interface refinements */
.tv-screen-frame {
  border: 10px solid var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
}

.tv-news-ticker {
  background: var(--color-lime);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
}

/* Chat Agents refinements */
.agent-btn {
  border-radius: var(--radius-md) !important;
  margin: 0 var(--space-2);
}

.agent-btn.active {
  background: rgba(var(--color-lime-rgb), 0.1) !important;
  color: var(--color-lime) !important;
  border-right: 3px solid var(--color-lime) !important;
}

/* ──────────────── COMPONENTS (Sync with Landing) ──────────────── */
.hero-visual {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 15s ease-in-out infinite;
}

.hero-orb-1 {
  width: 800px;
  height: 800px;
  background: radial-gradient(
    circle,
    rgba(204, 255, 0, 0.15) 0%,
    transparent 70%
  );
  top: -20%;
  left: 10%;
  animation-delay: 0s;
}
.hero-orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(0, 255, 255, 0.12) 0%,
    transparent 70%
  );
  bottom: -10%;
  right: -5%;
  animation-delay: 3s;
}
.hero-orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(255, 0, 255, 0.1) 0%,
    transparent 70%
  );
  top: 30%;
  left: -10%;
  animation-delay: 6s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
    opacity: 0.4;
  }
  66% {
    transform: translate(-30px, 40px) scale(0.9);
    opacity: 0.25;
  }
}

/* ──────────────── CUSTOM ALERT REFINEMENTS ──────────────── */
.custom-alert-box {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-glow) !important;
  backdrop-filter: blur(30px) !important;
  box-shadow: var(--shadow-2xl), var(--shadow-glow-lime) !important;
}

/* ──────────────── MOBILE ──────────────── */
@media (max-width: 1400px) {
  .main-content {
    padding: var(--space-12) var(--space-8);
  }
}

@media (max-width: 1200px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: var(--space-10) var(--space-6);
  }
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: var(--text-3xl);
  }
}

/* ──────────────── HOMEWORK & AI TUTOR ──────────────── */
.loader-scifi {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-cyan);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  margin-right: 10px;
}

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

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-good {
  background: rgba(204, 255, 0, 0.2);
  color: var(--color-lime);
  border: 1px solid var(--color-lime);
}

.status-bad {
  background: rgba(255, 0, 110, 0.2);
  color: var(--color-pink);
  border: 1px solid var(--color-pink);
}

/* ──────────────── MAGIC 8-BALL AI ──────────────── */
.magic-8-ball-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: var(--space-8) 0;
  perspective: 1000px;
  width: 100%; /* Full width */
}

.magic-stage {
  position: relative;
  width: 100%;
  max-width: 800px; /* Limit width */
  min-height: 460px; /* Fit Layout */
  margin: 0 auto 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.magic-8-ball {
  width: 440px; /* Big Size */
  height: 440px;
  background: radial-gradient(circle at 30% 30%, #444, #000 60%);
  border-radius: 50%;
  box-shadow: 
    inset -20px -20px 60px rgba(0,0,0,0.9), /* Deep inner shadow */
    0 0 60px rgba(88, 28, 255, 0.4), /* Outer Purple Neon */
    0 0 120px rgba(0, 198, 255, 0.3); /* Outer Blue Neon */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.5s ease;
  z-index: 10;
}

.magic-8-ball.shaking {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-2deg); }
  20%, 80% { transform: translate3d(4px, 0, 0) rotate(4deg); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0) rotate(-6deg); }
  40%, 60% { transform: translate3d(6px, 0, 0) rotate(6deg); }
}

.ball-window {
  width: 240px; /* Larger window */
  height: 240px;
  background: radial-gradient(circle, #581c87 0%, #2e1065 30%, #000 70%); /* Bright Purple Core fading to Black */
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.9); /* Deepen edges */
  border: 4px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.ball-triangle {
  width: 180px; /* Larger triangle */
  height: 180px;
  background: linear-gradient(135deg, #2563eb, #9333ea); /* Blue-Purple Gradient */
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%); /* Pointing DOWN */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  
  /* Adjusted padding: minimal top padding, maximized bottom padding to push text UP */
  padding: 10px 10px 90px 10px; 
  
  /* 3D Volume & Glow */
  box-shadow: 
    inset 0 20px 50px rgba(0,0,0,0.8), /* Deep shadow top */
    inset 0 -10px 30px rgba(255,255,255,0.4); /* Highlight bottom tip */
    
  filter: 
    drop-shadow(0 0 15px rgba(59, 130, 246, 0.9)) /* Blue Edge */
    drop-shadow(0 0 80px rgba(147, 51, 234, 0.8)); /* Purple Back Light */
  
  position: relative;
  animation: float3d 8s ease-in-out infinite; /* Slower, more complex float */
  transform-style: preserve-3d;
}

@keyframes float3d {
  0% { 
    transform: translate3d(0, 20px, 0) scale(0.95) rotateX(5deg) rotateY(-5deg) rotateZ(0deg); 
  }
  33% { 
    transform: translate3d(5px, 30px, 20px) scale(1.0) rotateX(0deg) rotateY(5deg) rotateZ(2deg); 
  }
  66% { 
    transform: translate3d(-5px, 25px, 10px) scale(1.05) rotateX(10deg) rotateY(-2deg) rotateZ(-2deg); 
  }
  100% { 
    transform: translate3d(0, 20px, 0) scale(0.95) rotateX(5deg) rotateY(-5deg) rotateZ(0deg); 
  }
}

.ball-content {
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.ball-icon {
  width: 90px; /* Slightly larger */
  height: 90px;
  margin-bottom: -12px; /* Pull text up to counteract icon move */
  margin-top: 15px; /* Push icon down */
  display: flex;
  align-items: center;
  justify-content: center;
}

.ball-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen; /* REMOVES BLACK BACKGROUND */
  
  /* FIX: Remove visible square edges using Mask + Contrast */
  filter: contrast(1.2) brightness(0.9) drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
  -webkit-mask-image: radial-gradient(circle, black 60%, transparent 95%);
  mask-image: radial-gradient(circle, black 60%, transparent 95%);
}

.ball-text {
  font-size: 14px; /* Bigger text */
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  max-width: 120px;
}

/* ABSOLUTE POSITIONING FOR ARROWS */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100 !important;
  
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--color-cyan);
  color: var(--color-cyan);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.nav-arrow.left {
  left: 10px;
}

.nav-arrow.right {
  right: 10px;
}

.nav-arrow:hover {
  background: var(--color-lime);
  color: black;
  box-shadow: 0 0 15px rgba(204, 255, 0, 0.5);
  transform: scale(1.1);
}

/* ──────────────── MAGIC CHAT INTERFACE ──────────────── */

.magic-ball-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.magic-chat-section {
  width: 100%;
  max-width: 800px; /* Wider container */
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-history {
  height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 10px;
  /* Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-cyan) rgba(255,255,255,0.05);
}
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--color-cyan); border-radius: 3px; }

.chat-message {
  display: flex;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.chat-message.user-message { justify-content: flex-end; }
.chat-message.ai-message { justify-content: flex-start; }

.message-content {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: white;
  white-space: pre-wrap; /* Preserve formatting */
}

/* User Bubble */
.user-message .message-content {
  background: linear-gradient(135deg, #2563eb, #9333ea);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* AI Bubble */
.ai-message .message-content {
  background: rgba(30, 30, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.magic-input-container {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: rgba(0,0,0,0.4);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: border-color 0.3s ease;
}

.magic-input-container:focus-within {
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

textarea.magic-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  padding: 8px 5px;
  resize: none; /* Auto-grow via JS ideally, but allow vertical */
  resize: vertical;
  min-height: 24px;
  max-height: 200px;
  font-family: inherit;
  outline: none;
}

.magic-btn-send {
  background: var(--color-cyan);
  color: black;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.magic-btn-send:hover { transform: scale(1.1); }

.magic-btn-send:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(204, 255, 0, 0.6);
}

.magic-btn-send span {
  font-size: 28px;
  color: black;
  font-weight: bold;
}
  }
}
