/**
 * Burger Menu Styles
 */

/* Burger Button */
.burger-menu-button {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.burger-menu-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.burger-menu-button.active {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.burger-line {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-menu-button.active .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-menu-button.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu-button.active .burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Menu Overlay */
.burger-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9998;
  display: none;
  animation: fadeIn 0.3s ease;
}

.burger-menu.open {
  display: block;
}

/* Menu Panel */
.burger-menu::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 375px;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.burger-menu.open::before {
  transform: translateX(0);
}

.burger-menu-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  padding: 25px 25px 25px 90px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.burger-menu.open .burger-menu-header {
  transform: translateX(0);
}

.burger-menu-header h3 {
  margin: 0;
  color: white;
  font-size: 24px;
  font-weight: 600;
}

/* Menu Content */
.burger-menu-content {
  position: fixed;
  top: 90px;
  left: 0;
  width: 350px;
  height: calc(100% - 90px);
  overflow-y: auto;
  padding: 20px;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.burger-menu.open .burger-menu-content {
  transform: translateX(0);
}

/* Menu Items */
.burger-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.burger-menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(5px);
}

.burger-menu-item:active {
  transform: translateX(5px) scale(0.98);
}

.burger-menu-item i {
  font-size: 20px;
  width: 30px;
  text-align: center;
}

.burger-menu-item span:nth-child(2) {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
}

/* Menu Item Badge (for notes indicator) */
.menu-item-badge {
  display: none;
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.8);
}

/* Menu Item Toggle (for performance mode) */
.menu-item-toggle {
  padding: 4px 12px;
  background: rgba(149, 165, 166, 0.3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #bdc3c7;
  transition: all 0.3s ease;
}

.menu-item-toggle.active {
  background: rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .burger-menu-button {
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
  }

  .burger-menu::before,
  .burger-menu-header,
  .burger-menu-content {
    width: 280px;
  }

  .burger-menu-item {
    padding: 15px;
    font-size: 14px;
  }

  .burger-menu-item i {
    font-size: 18px;
  }
}

/* Print mode - hide burger menu */
@media print {
  .burger-menu-button,
  .burger-menu {
    display: none !important;
  }
}

/* PDF export - hide burger menu */
html.reveal-print .burger-menu-button,
html.reveal-print .burger-menu {
  display: none !important;
}

/* ==================== NAVIGATION BUTTONS ==================== */

.nav-buttons-container {
  position: fixed;
  top: 80px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9997;
}

.nav-button {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3a3f5c 0%, #2c3142 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  color: #ccc;
  font-size: 18px;
}

.nav-button:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-button:active {
  transform: scale(0.95);
}

#nav-home-btn:hover {
  background: linear-gradient(135deg, #06d6a0 0%, #059669 100%);
  box-shadow: 0 5px 15px rgba(6, 214, 160, 0.4);
}

#nav-bookmark-btn:hover {
  background: linear-gradient(135deg, #f77f00 0%, #d45d00 100%);
  box-shadow: 0 5px 15px rgba(247, 127, 0, 0.4);
}

#nav-bookmark-btn.bookmark-saved {
  animation: bookmarkPulse 0.6s ease;
}

@keyframes bookmarkPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); background: linear-gradient(135deg, #f77f00 0%, #d45d00 100%); }
  100% { transform: scale(1); }
}

#nav-goto-btn:hover {
  background: linear-gradient(135deg, #619acc 0%, #4a7eb8 100%);
  box-shadow: 0 5px 15px rgba(97, 154, 204, 0.4);
}

/* ==================== BOOKMARK NOTIFICATION ==================== */

.bookmark-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  z-index: 10002;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bookmark-notification.show {
  transform: translateX(-50%) translateY(0);
}

.bookmark-notification i {
  color: #f77f00;
}

/* ==================== BOOKMARKS OVERLAY ==================== */

.bookmarks-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bookmarks-overlay.visible {
  display: flex;
}

.bookmarks-dialog {
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: linear-gradient(135deg, #1f2933 0%, #252d38 100%);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bookmarks-header h3 {
  margin: 0;
  color: white;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bookmarks-header h3 i {
  color: #f77f00;
}

.bookmarks-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 5px;
  transition: color 0.2s;
}

.bookmarks-close:hover {
  color: white;
}

.bookmarks-content {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
}

/* Empty state */
.bookmarks-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.bookmarks-empty i {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.bookmarks-empty p {
  font-size: 18px;
  margin: 0 0 10px;
  color: #aaa;
}

.bookmarks-empty small {
  font-size: 14px;
}

/* Chapter sections */
.bookmarks-chapter {
  margin-bottom: 30px;
}

.chapter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-title {
  color: #9acfff;
  font-size: 16px;
  font-weight: 600;
}

.chapter-count {
  background: rgba(154, 207, 255, 0.2);
  color: #9acfff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
}

/* Bookmark cards grid */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.bookmark-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bookmark-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.bookmark-thumb {
  position: relative;
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: #2a2f4a;
}

.bookmark-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(231, 76, 60, 0.9);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bookmark-card:hover .bookmark-delete {
  opacity: 1;
}

.bookmark-delete:hover {
  background: #c0392b;
  transform: scale(1.1);
}

.bookmark-info {
  padding: 12px;
}

.bookmark-title {
  color: #eee;
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-buttons-container {
    top: 70px;
    left: 15px;
  }

  .nav-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .bookmarks-dialog {
    width: 95%;
    max-height: 90vh;
  }

  .bookmarks-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .bookmark-thumb {
    height: 80px;
  }
}

/* Print/PDF - hide navigation buttons */
@media print {
  .nav-buttons-container,
  .bookmarks-overlay,
  .bookmark-notification {
    display: none !important;
  }
}

html.reveal-print .nav-buttons-container,
html.reveal-print .bookmarks-overlay,
html.reveal-print .bookmark-notification {
  display: none !important;
}

/* Timer configuration modal */
.timer-config-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.timer-config-overlay.visible {
  display: flex;
}

.timer-config-dialog {
  width: 320px;
  background: #1f2933;
  color: #f5f7fa;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timer-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.timer-config-header h4 {
  margin: 0;
  font-size: 18px;
}

.timer-config-close {
  background: transparent;
  border: none;
  color: #f5f7fa;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.timer-config-body {
  padding: 16px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timer-config-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.timer-config-label input[type="number"] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7fa;
  font-size: 15px;
}

.timer-config-label input[type="number"]:focus {
  outline: 2px solid #667eea;
  border-color: #667eea;
}

.timer-config-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.timer-config-checkbox input {
  width: 18px;
  height: 18px;
}

.timer-config-error {
  min-height: 18px;
  font-size: 13px;
  color: #ff9f43;
}

.timer-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
}

.timer-config-actions button {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.timer-config-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f7fa;
}

.timer-config-start {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Timer display */
.timer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.timer-container {
  position: fixed;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.timer-center {
  position: static;
}

.timer-top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.timer-display {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.timer-close-button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
