/* ==========================================================================
   NOTES CATEGORY - Cyber Glassmorphism Theme (v3.1)
   Designed for Campus Students
   ========================================================================== */

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 26, 43, 0.65);
  --bg-card-hover: rgba(30, 41, 67, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-glow: rgba(99, 102, 241, 0.25);
  
  --primary-accent: #6366f1;
  --primary-glow: #818cf8;
  --secondary-accent: #ec4899;
  --tertiary-accent: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --font-main: 'Inter', 'Noto Sans Sinhala', 'Noto Sans Devanagari', 'Noto Sans JP', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

  --header-height: 72px;
  --sidebar-width: 275px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   CUSTOM GLOWING SCROLLBARS (Cyber Neon Glassmorphism)
   ========================================================================== */

/* WebKit Custom Scrollbars (Chrome, Edge, Safari, Brave) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 15, 25, 0.6);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1 0%, #ec4899 100%);
  border-radius: 10px;
  border: 2px solid rgba(11, 15, 25, 0.6);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #818cf8 0%, #f472b6 100%);
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.8);
}

/* Sidebar Specific Glowing Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 7px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1 0%, #06b6d4 100%);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Main Content Viewport Glowing Scrollbar */
.content-viewport::-webkit-scrollbar {
  width: 9px;
}

.content-viewport::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

.content-viewport::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #818cf8 0%, #ec4899 100%);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.6);
}

/* Horizontal Module Tabs Glowing Scrollbar */
.module-tabs::-webkit-scrollbar {
  height: 6px;
}

.module-tabs::-webkit-scrollbar-track {
  background: rgba(18, 26, 43, 0.5);
  border-radius: 10px;
}

.module-tabs::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #6366f1 0%, #ec4899 50%, #38bdf8 100%);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Firefox Scrollbar Styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #6366f1 rgba(11, 15, 25, 0.6);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 70%);
  bottom: -150px;
  right: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
  top: 40%;
  left: 45%;
  animation-delay: -8s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
  50% { transform: scale(1.15) translate(30px, -20px); opacity: 0.55; }
  100% { transform: scale(0.95) translate(-20px, 30px); opacity: 0.4; }
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Glass Header */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.header-container {
  max-width: 1650px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.glow-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.6);
  animation: floatAvatar 4s ease-in-out infinite alternate;
}

@keyframes floatAvatar {
  0% { transform: translateY(0); box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
  100% { transform: translateY(-4px); box-shadow: 0 0 25px rgba(236, 72, 153, 0.8); }
}

.glowing-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(
    90deg,
    #818cf8 0%,
    #c084fc 25%,
    #f472b6 50%,
    #38bdf8 75%,
    #818cf8 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shineGradient 5s linear infinite;
  text-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

@keyframes shineGradient {
  to {
    background-position: 200% center;
  }
}

.accent-text {
  font-weight: 800;
}

.badge-tag {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-glow);
  border: 1px solid rgba(129, 140, 248, 0.4);
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-apk-download {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #10b981 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.btn-apk-download:hover {
  background: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-1px);
}

.btn-exe-download {
  background: rgba(129, 140, 248, 0.15) !important;
  border-color: rgba(129, 140, 248, 0.4) !important;
  color: #818cf8 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.btn-exe-download:hover {
  background: rgba(129, 140, 248, 0.3) !important;
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.4) !important;
  transform: translateY(-1px);
}

.search-bar-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.search-bar-wrapper input {
  width: 100%;
  background: rgba(18, 26, 43, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 10px 42px 10px 40px;
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-bar-wrapper input:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  background: rgba(24, 34, 56, 0.95);
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

#clearSearch {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-btn.btn-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(236, 72, 153, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.glass-btn.btn-primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 1), rgba(236, 72, 153, 1));
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon.danger:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

.workspace-wrapper {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin: 12px auto;
  padding: 0 16px;
  min-height: calc(100vh - var(--header-height) - 30px);
  box-sizing: border-box;
}

.app-layout {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 16px 12px 120px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--header-height) - 15px);
  overflow-y: auto !important;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.sidebar.mobile-open {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 320px !important;
  max-width: 86vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100% !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 16px 12px 140px 12px !important;
  border-radius: 0 !important;
  z-index: 999999 !important;
  transform: translateX(0) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.95) !important;
}

.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3) 0%, rgba(236, 72, 153, 0.15) 100%);
  border: 1px solid rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-add-mini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: var(--transition-fast);
}

.btn-add-mini:hover {
  background: var(--primary-accent);
  color: white;
  border-color: var(--primary-glow);
  transform: scale(1.1);
}

/* 4-Level Deep Tree View */
.faculties-tree-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tree-node {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.4);
  transition: var(--transition-fast);
}

.tree-node.expanded {
  overflow: visible;
}

.tree-node-header {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
  user-select: none;
  border-radius: var(--radius-sm);
}

.tree-node-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tree-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tree-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.85;
  flex-shrink: 0;
}

.tree-controls:hover {
  opacity: 1;
}

.tree-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-left: 2px;
}

.tree-node.expanded > .tree-node-header .tree-chevron {
  transform: rotate(90deg);
}

.tree-children {
  display: none;
  padding-left: 6px;
  flex-direction: column;
  gap: 6px;
  border-left: 1px dashed rgba(255, 255, 255, 0.15);
  margin: 4px 4px 6px 8px;
}

.tree-node.expanded > .tree-children {
  display: flex;
}

.subject-item-node {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.subject-item-node:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.subject-item-node.active {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(129, 140, 248, 0.4);
  font-weight: 600;
}

.content-viewport {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - var(--header-height) - 30px);
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

/* Timetable Styles */
.timetable-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.view-title-group {
  flex: 1;
  min-width: 200px;
}

.view-title-group h2 {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  word-break: break-word;
  background: linear-gradient(90deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.timetable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.day-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--primary-accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: var(--transition-fast);
}

.slot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.2);
}

.slot-time {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-subject {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.slot-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition-fast);
}

.slot-card:hover .slot-actions {
  opacity: 1;
}

/* Subject View & Tabbed Modules */
.subject-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.subject-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Accordion Module Cards */
.module-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accordion-card {
  background: rgba(18, 26, 43, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-normal);
}

.accordion-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.accordion-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.category-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-syllabus { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.tag-presentation { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }
.tag-shortnote { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.tag-pastpaper { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.tag-assignment { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.tag-midexam { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.tag-book { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }

.accordion-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.accordion-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arrow-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.accordion-card.open .arrow-icon {
  transform: rotate(180deg);
  color: var(--primary-glow);
}

.accordion-body {
  display: none;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 15, 25, 0.4);
}

.accordion-card.open .accordion-body {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* Recommended Reading Book Metadata Banner & Page Counter */
.book-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}

.book-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-meta-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #93c5fd;
}

.page-counter-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-counter-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Image Attachment inside Markdown */
.markdown-rendered img {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin: 12px 0;
  object-fit: contain;
  display: block;
}

/* Distraction-Free Fullscreen Note Reader Modal */
.fullscreen-reader-container {
  width: 92vw;
  height: 92vh;
  max-width: 1100px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.reader-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 26, 43, 0.7);
}

.reader-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reader-title-area h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-body {
  padding: 40px 60px;
  overflow-y: auto;
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Rendered Markdown Styling */
.markdown-rendered {
  line-height: 1.7;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4 {
  color: #f8fafc;
  margin: 16px 0 10px 0;
  font-weight: 700;
}

.markdown-rendered h1 { font-size: 1.5rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; color: var(--primary-glow); }
.markdown-rendered h2 { font-size: 1.3rem; color: #a5b4fc; }
.markdown-rendered h3 { font-size: 1.1rem; color: #38bdf8; }

.markdown-rendered p {
  margin-bottom: 12px;
}

.markdown-rendered strong {
  color: #fbbf24;
  font-weight: 700;
}

.markdown-rendered em {
  color: #f472b6;
  font-style: italic;
}

.markdown-rendered ul,
.markdown-rendered ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.markdown-rendered li {
  margin-bottom: 6px;
}

.markdown-rendered blockquote {
  border-left: 4px solid var(--primary-accent);
  background: rgba(99, 102, 241, 0.1);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  color: #cbd5e1;
  font-style: italic;
}

.markdown-rendered code {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88rem;
  color: #38bdf8;
}

.markdown-rendered pre {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow-x: auto;
  margin: 14px 0;
}

.markdown-rendered pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
}

.markdown-rendered hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 20px 0;
}

/* Modal Form Controls */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.glass-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: white;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 26, 43, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--primary-accent);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s ease-out forwards;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--primary-glow);
  opacity: 0.7;
}

/* Print Style for PDF Export */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .glass-header, .sidebar, .module-tabs, .accordion-controls, #toastContainer, .header-actions, .search-bar-wrapper {
    display: none !important;
  }
  .app-layout {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .content-viewport {
    border: none !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  .markdown-rendered {
    color: black !important;
  }
  .markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3 {
    color: black !important;
  }
  .markdown-rendered strong {
    color: #1e3a8a !important;
  }
}

/* Mobile & Collapsible Sidebar Styles */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 8px 12px;
}

.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 12px;
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 80;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

#enableNotifyBtn.active-bell {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Responsive Breakpoints for Mobile & Tablet */
@media (max-width: 868px) {
  :root {
    --header-height: 64px;
    --sidebar-width: 300px;
  }

  body {
    overflow-x: hidden;
  }

  /* Header adjustments for Mobile */
  .glass-header {
    padding: 0 8px;
    height: var(--header-height);
  }

  .header-container {
    gap: 6px;
    padding: 0;
    justify-content: space-between;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .brand-section {
    gap: 6px;
    flex-shrink: 0;
  }

  .glowing-title {
    font-size: 1.05rem;
  }

  .badge-tag {
    display: none;
  }

  .glow-avatar {
    width: 34px;
    height: 34px;
  }

  .search-bar-wrapper {
    max-width: 130px;
    min-width: 80px;
    padding: 6px 10px;
    flex: 1;
  }

  .search-bar-wrapper input {
    font-size: 0.8rem;
  }

  .header-actions {
    gap: 4px;
    flex-shrink: 0;
  }

  .header-actions .glass-btn {
    padding: 7px 9px;
    font-size: 0.85rem;
  }

  .btn-text {
    display: none;
  }

  /* Body Background Scroll Lock when Mobile Sidebar is Open */
  body.sidebar-open {
    overflow: hidden !important;
    touch-action: none !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Mobile Collapsible Sidebar Fixes - Guaranteed True 100% Edge-to-Edge Full Screen Height */
  .sidebar-mobile-header {
    display: flex !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 310px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.95) !important;
    padding: 16px 12px 12px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
  }

  .faculties-tree-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    max-height: none !important;
    padding-bottom: 240px !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    left: 0 !important;
    border-radius: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
  }

  .sidebar-backdrop {
    z-index: 99999;
  }


  /* Tree Items Overflow Fix for Mobile */
  .tree-node, .faculty-item, .year-item, .semester-item, .subject-item {
    max-width: 100%;
    overflow: hidden;
  }

  .node-header, .faculty-header, .year-header, .semester-header, .subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
  }

  .node-title, .item-label, .subject-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
  }

  .node-actions, .item-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }

  .node-actions button, .item-actions button {
    padding: 3px 6px;
    font-size: 0.75rem;
  }

  /* Main Workspace Mobile Layout - 100% Screen Fill */
  .app-layout {
    flex-direction: column;
    padding: 10px 8px;
    gap: 10px;
    max-width: 100vw;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    overflow-x: hidden;
  }

  .content-viewport {
    width: 100%;
    padding: 14px 10px;
    min-height: calc(100vh - var(--header-height) - 30px);
    min-height: calc(100dvh - var(--header-height) - 30px);
    max-height: none;
    overflow-x: hidden;
  }

  .timetable-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timetable-card {
    max-width: 100%;
  }

  .glass-modal {
    width: 94vw;
    max-width: 500px;
    padding: 16px;
    margin: 0 auto;
  }

  /* Subject View Action Bar & Responsive Screen Containment */
  .workspace-wrapper, .app-layout, .content-viewport, .subject-view {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .subject-header {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .subject-header h2 {
    word-break: break-word !important;
  }

  .module-tabs {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .subject-action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .subject-action-bar .glass-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Fullscreen Note Reader Header Mobile Overlap Fix */
  .reader-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
  }

  .reader-title-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .reader-title-area h2 {
    font-size: 1.15rem;
    word-break: break-word;
    line-height: 1.4;
  }

  .reader-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .reader-actions .glass-btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 8px 12px;
    justify-content: center;
  }

  .reader-body {
    padding: 16px 18px;
  }
}

@media (max-width: 480px) {
  .glowing-title {
    font-size: 0.95rem;
  }
  
  .glow-avatar {
    width: 30px;
    height: 30px;
  }

  .search-bar-wrapper {
    display: none;
  }

  .header-actions {
    gap: 3px;
  }

  .header-actions .glass-btn {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   TIME PICKER UI STYLES (Google Calendar style)
   ========================================================================== */
.time-picker-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
}

.time-row-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.time-label-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 55px;
}

.time-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-select {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.time-select:focus {
  border-color: var(--primary-glow);
}

.am-pm-toggle {
  display: inline-flex;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
}

.am-pm-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.am-pm-toggle button.active {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.quick-time-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.time-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.time-chip:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
  border-color: var(--primary-glow);
}

/* Print / Save as PDF Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .glass-header, .sidebar, .sidebar-backdrop, .subject-action-bar, .modal-backdrop, #enableNotifyBtn {
    display: none !important;
  }
  .app-layout {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  .content-viewport, .reader-modal-container {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
  }
  .reader-body, .reader-text {
    color: #000000 !important;
  }
}

/* ==========================================================================
   GOOGLE DOCS STYLE RICH TEXT EDITOR & SIDE SPLIT MEDIA / PDF DRAWER
   ========================================================================== */

/* Rich Text Formatting Toolbar */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
}

.editor-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
  border-color: var(--primary-glow);
  transform: translateY(-1px);
}

.editor-btn.active {
  background: var(--primary-accent);
  color: white;
}

.editor-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.editor-select:focus {
  border-color: var(--primary-glow);
}

.editor-divider {
  width: 1px;
  height: 22px;
  background: var(--glass-border);
  margin: 0 4px;
}

.editor-contenteditable {
  min-height: 220px;
  max-height: 480px;
  overflow-y: auto;
  padding: 14px 16px;
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  line-height: 1.6;
  outline: none;
}

.editor-contenteditable:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Inline Attachment Badges inside Text */
.inline-attach-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin: 0 4px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.inline-attach-tag:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.inline-attach-tag.pdf-tag {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.inline-attach-tag.img-tag {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.remove-attachment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  cursor: pointer;
  vertical-align: middle;
}

.remove-attachment-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.2);
}

/* Floating Edit Action Button (Google Docs Style Pencil) */
.fab-edit-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab-edit-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.7);
}

.hidden {
  display: none !important;
}

/* Side Split Media / PDF Reader Drawer */
.media-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
}

.media-drawer-overlay.hidden {
  display: none !important;
}

.media-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: #0f172a;
  border-left: 1px solid var(--glass-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-drawer.hidden {
  transform: translateX(105%);
  display: none !important;
}

.media-drawer-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.8);
}

.media-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.media-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.media-drawer.fullscreen-mode {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 200000 !important;
  border-radius: 0 !important;
}

.pdf-preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 80vh;
  border: none;
  border-radius: var(--radius-sm);
}

.img-preview-full {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.media-drawer.fullscreen-mode .img-preview-full {
  max-height: 94vh;
}

.pdf-bookmark-banner {
  width: 100%;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Note Sheet Container & In-Place Google Docs Style Editor */
.note-sheet-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.sheet-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.sheet-status-badge {
  font-size: 0.78rem;
  color: var(--primary-glow);
  font-weight: 600;
}

.sheet-edit-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  color: var(--text-main);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.sheet-edit-btn:hover {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
}

.sheet-paper {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--glass-border);
  padding: 20px;
  border-radius: var(--radius-md);
  min-height: 120px;
  line-height: 1.7;
}

.inline-docs-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--primary-accent);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  padding: 16px;
  border-radius: var(--radius-md);
}

.sheet-paper-editable {
  min-height: 220px;
  max-height: 60vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  line-height: 1.7;
}

.sheet-paper-editable:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}

.sheet-bottom-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Google Drive Sync UI Styles */
.btn-cloud-sync {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(52, 168, 83, 0.2));
  border: 1px solid rgba(66, 133, 244, 0.5);
  color: var(--text-main);
}
.btn-cloud-sync:hover {
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: white;
  box-shadow: 0 0 16px rgba(66, 133, 244, 0.5);
}

.cloud-status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.15);
  border: 1px solid rgba(66, 133, 244, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #4285f4;
  flex-shrink: 0;
}

.status-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.status-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  background: #ffffff;
  color: #1f2937;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: var(--transition-fast);
}

.google-auth-btn:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.cloud-info-box {
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  color: #34d399;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Mobile Typography & Element Scale Optimizations */
@media (max-width: 868px) {
  .tree-title {
    font-size: 0.78rem !important;
  }
  .tree-node-header {
    padding: 6px 8px !important;
  }
  .glowing-title {
    font-size: 1.05rem !important;
  }
  .view-title-group h2 {
    font-size: 1.15rem !important;
  }
  .tab-btn {
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
  }
  .accordion-title {
    font-size: 0.84rem !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .accordion-header {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .accordion-title-group {
    gap: 6px !important;
    flex: 1;
  }
  .category-tag {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
  }
  .sheet-paper {
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
  }
  .sheet-paper h1, .sheet-paper h2, .sheet-paper h3 {
    font-size: 1.1rem !important;
  }
  .fullscreen-reader-container {
    width: 98vw !important;
    height: 96vh !important;
    padding: 12px !important;
  }
  .reader-title-area h2 {
    font-size: 0.95rem !important;
  }
  .reader-actions {
    gap: 6px !important;
  }
  .reader-actions .glass-btn {
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
  }
  .module-tag {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
  }
  .fab-edit-btn {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
  .media-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}

/* ==========================================================================
   ROTATING NEON GRADIENT FLOATING DOWNLOAD BAR
   ========================================================================== */
.floating-download-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99990;
  width: calc(100% - 32px);
  max-width: 900px;
  pointer-events: auto;
}

.floating-download-container {
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-download-container:hover {
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.4);
}

.download-bar-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 0.88rem;
}

.download-bar-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Neon Rotating Border Buttons */
@property --neon-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.neon-glow-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 30px;
  text-decoration: none;
  background: conic-gradient(from var(--neon-angle), #10b981, #6366f1, #ec4899, #f59e0b, #10b981);
  animation: rotateNeon 3s linear infinite;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-neon-apk {
  background: conic-gradient(from var(--neon-angle), #10b981, #34d399, #059669, #a7f3d0, #10b981);
  animation: rotateNeon 2.5s linear infinite;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.btn-neon-exe {
  background: conic-gradient(from var(--neon-angle), #6366f1, #818cf8, #a855f7, #ec4899, #6366f1);
  animation: rotateNeon 2.5s linear infinite;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
}

.neon-glow-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.btn-neon-apk:hover {
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
}

.btn-neon-exe:hover {
  box-shadow: 0 0 25px rgba(129, 140, 248, 0.7);
}

.neon-btn-content {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 28px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

@keyframes rotateNeon {
  0% {
    --neon-angle: 0deg;
  }
  100% {
    --neon-angle: 360deg;
  }
}

@media (max-width: 768px) {
  .floating-download-bar {
    bottom: 10px;
    width: calc(100% - 16px);
  }
  .floating-download-container {
    flex-direction: column;
    text-align: center;
    padding: 10px 14px;
    gap: 8px;
  }
  .download-bar-text span {
    font-size: 0.78rem;
  }
  .download-bar-buttons {
    width: 100%;
    justify-content: center;
  }
  .neon-btn-content {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}
