:root {
  /* High-contrast, energetic palette */
  --primary-color: #3B82F6; /* Electric Blue */
  --secondary-color: #8B5CF6; /* Neon Purple */
  --accent-color: #FACC15; /* Bright Yellow */
  --bg-color: #F9FAFB; /* Soft Off-White */
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --card-bg: #FFFFFF;
  --sidebar-bg: #F3F4F6;
  --border-color: #E5E7EB;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.5); /* Neon glow */
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --transition-speed: 0.2s;
}

[data-theme="dark"] {
  --bg-color: #0F172A; /* Deep Navy / Charcoal */
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --card-bg: #1E293B;
  --sidebar-bg: #0B1120;
  --border-color: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow: hidden; /* App-like feel */
}

/* App Layout */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar (Desktop) */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: transform var(--transition-speed);
}

.sidebar-header {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-speed);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px); /* Slight lift */
}

.nav-link.active {
  background-color: rgba(59, 130, 246, 0.1); /* Light blue bg */
}

/* Sidebar Tree */
.sidebar-tree {
  list-style: none;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-node {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-node:hover, .tree-node.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.tree-node i {
  font-size: 1rem;
}

.tree-children {
  padding-left: 16px;
  border-left: 1px dashed var(--border-color);
  margin-left: 12px;
  margin-top: 4px;
  margin-bottom: 4px;
  display: none;
}

.tree-children.active {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.topbar {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: var(--bg-color);
}

.view-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* View Containers */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: none;
}

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

/* Chat View */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 95%;
  animation: slideIn 0.3s ease-out;
}

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

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 16px 20px;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 4px var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.message.ai {
  align-self: flex-start;
  background-color: var(--card-bg);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) var(--border-radius-lg) 4px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  position: relative;
}

.message-content {
  line-height: 1.6;
  overflow-x: auto;
  word-wrap: break-word;
}

.message-content p {
  margin-bottom: 14px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-small:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* GenZ Save Button */
.btn-save-genz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: 4px;
}

.save-icon-wrapper {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn-save-genz:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.btn-save-genz:active {
  transform: scale(0.95);
}

[data-theme="dark"] .btn-save-genz {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #A78BFA;
}

[data-theme="dark"] .btn-save-genz:hover {
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
}

.chat-input-container {
  margin-top: auto;
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-modes {
  display: flex;
  gap: 12px;
}

.mode-toggle {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.mode-toggle.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  resize: none;
  outline: none;
  max-height: 150px;
  min-height: 50px;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Folders View */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.folder-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.folder-card:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.folder-icon {
  font-size: 3rem;
}

.folder-name {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
}

.folder-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background-color: var(--bg-color);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Inside Folder View */
.folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.btn-revise {
  background-color: var(--accent-color);
  color: #1F2937;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-revise:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(250, 204, 21, 0.4);
}

.saved-chats-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.saved-chat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.saved-q {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.saved-a {
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Revision View */
.revision-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
}

.revision-content h2 {
  color: var(--primary-color);
  margin-bottom: 16px;
  margin-top: 24px;
}

.revision-content h2:first-child {
  margin-top: 0;
}

.revision-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.revision-content li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-color);
  color: var(--text-primary);
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Save Modal Options */
.save-option-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-option-btn:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.save-option-btn.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Markdown Content Styling */
.content-markdown h1, .content-markdown h2, .content-markdown h3, .content-markdown h4 {
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 700;
}

.content-markdown h1 { font-size: 1.4rem; }
.content-markdown h2 { font-size: 1.2rem; }
.content-markdown h3 { font-size: 1.1rem; }

.content-markdown p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.content-markdown strong {
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1); /* Subtle highlight for bold terms */
  padding: 0 2px;
  border-radius: 3px;
}

.content-markdown ul, .content-markdown ol {
  margin-bottom: 12px;
  padding-left: 20px;
}

.content-markdown li {
  margin-bottom: 4px;
}

/* Mobile Nav */
.bottom-nav {
  display: none;
  height: 60px;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 0 16px;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.nav-item-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-item-mobile.active {
  color: var(--primary-color);
}

.nav-item-mobile i {
  font-size: 1.25rem;
}

/* EXAM MODE ⚡ */
.exam-mode-active .bottom-nav,
.exam-mode-active .topbar:not(.exam-topbar) {
  display: none !important;
}

.exam-mode-active .main-content {
  flex: 1;
  padding-bottom: 0;
  background-color: var(--bg-color);
}

.exam-mode-active .chat-container {
  max-width: 900px;
  padding-top: 80px;
}

.exam-topbar {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--card-bg);
  border-bottom: 2px solid var(--accent-color);
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-md);
}

.exam-mode-active .exam-topbar {
  display: flex;
}

.exam-badge {
  background: var(--accent-color);
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: pulse-yellow 2s infinite;
}

@keyframes pulse-yellow {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* Response Modes */
.response-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.response-mode-pill {
  white-space: nowrap;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.response-mode-pill.active {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Exam Quick Actions */
.exam-quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.btn-exam-action {
  flex: 1;
  min-width: 100px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 10px 6px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-exam-action i {
  font-size: 1.2rem;
  color: var(--secondary-color);
}

  color: var(--secondary-color);
}

.btn-exam-action:hover {
  transform: translateY(-3px);
  border-color: var(--secondary-color);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: var(--shadow-md);
}

.btn-exam-action:active {
  transform: scale(0.95);
}

.btn-exam-action.active {
  border-color: var(--secondary-color);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.btn-exam-action.active i {
  color: var(--secondary-color);
}

.btn-exam-action.special {
  border-color: var(--accent-color);
  background: rgba(250, 204, 21, 0.05);
}

.btn-exam-action.special i {
  color: #D97706;
}

/* Exam Results Panel */
.exam-results-panel {
  position: fixed;
  right: -100%;
  top: 60px;
  bottom: 0;
  width: 400px;
  background: var(--card-bg);
  border-left: 2px solid var(--border-color);
  z-index: 90;
  transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.exam-results-panel.active {
  right: 0;
}

.results-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* High Contrast Overrides */
.exam-mode-active .message.ai {
  border-left: 4px solid var(--secondary-color);
}

.exam-mode-active .chat-input-container {
  border-top: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* Last Minute Mode Toggle */
.last-minute-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--secondary-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Exam Guide Panel */
.exam-guide-panel {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  animation: fadeIn 0.5s ease-out;
}

.exam-mode-active .exam-guide-panel {
  display: block;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.guide-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.guide-item i {
  font-size: 1.25rem;
  color: var(--secondary-color);
  margin-top: 2px;
}

.guide-item h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.guide-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

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

@media (max-width: 900px) {
  .exam-results-panel {
    width: 100%;
    top: 100%;
    right: 0;
    transition: top 0.4s ease;
  }
  .exam-results-panel.active {
    top: 60px;
  }
}

/* 10-Min Revise Lightning Animation */
.lightning-strike-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.lightning-strike-container.active {
  display: block;
}

.lightning-bolt {
  position: absolute;
  font-size: 5rem;
  color: #FACC15;
  filter: drop-shadow(0 0 20px #FACC15);
  opacity: 0;
  transform: scale(0.5);
}

.lightning-bolt.strike {
  animation: bolt-strike 0.3s ease-out forwards;
}

@keyframes bolt-strike {
  0% { opacity: 0; transform: scale(2) translateY(-100px); }
  20% { opacity: 1; transform: scale(1) translateY(0); }
  40% { opacity: 0.5; }
  60% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.2); }
}

.screen-flash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  opacity: 0;
}

.screen-flash.active {
  animation: quick-flash 0.2s ease-out;
}

@keyframes quick-flash {
  0% { opacity: 0.5; }
  100% { opacity: 0; }
}

/* Focus Transition Animation */
.focus-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  animation: overlayFade 1.1s ease-out forwards;
}

.focus-pulse-circle {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.5);
  animation: pulseRipple 1.1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes overlayFade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pulseRipple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(150);
    opacity: 0;
  }
}
/* Auth & Profile Styles */
#user-auth-section {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#user-profile {
  padding: 8px 0;
}

#user-avatar {
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

#user-email {
  color: var(--text-primary);
}

#btn-sign-out:hover {
  color: #EF4444; /* Alert Red */
  transform: scale(1.1);
  transition: all 0.2s;
}

/* Modal specific tweaks for Auth */
#auth-modal .modal-content {
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.3s ease-out;
}

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

#auth-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#btn-auth-switch:hover {
  text-decoration: underline;
}

/* Profile loading state */
.profile-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Premium Pricing Modal & Tier System */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background: var(--card-bg);
  transition: all 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.plan-card.premium-pro {
  border-color: var(--primary-color);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.02) 0%, rgba(99, 102, 241, 0.05) 100%);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08);
}

.plan-card.premium-pro::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.plan-features {
  font-size: 0.85rem;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li i {
  font-size: 1rem;
}

.plan-features li.locked-feature {
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Padlock icon positioning in buttons */
.mode-toggle .ph-lock,
.btn-small .ph-lock {
  color: var(--accent-color);
  font-size: 0.95rem;
}


