/* =========================================
   BASE STYLES — Ultra-Premium Dark Theme
   Source Serif 4 + System Fonts
   ========================================= */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  font-family:
    "Source Serif 4", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  background-color: #08080a;
  color: #f5f5f7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Source Serif 4 for all headings, titles, and prominent text */
h1, h2, h3, h4, h5, h6,
.header-center,
.row-title,
.pdf-title,
.cinematic-title,
.section-heading {
  font-family: "Source Serif 4", Georgia, serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

/* Descriptions and body text */
.pdf-description,
.cinematic-desc,
.main-content p {
  font-family: "Source Serif 4", Georgia, serif;
  font-optical-sizing: auto;
}

.hidden {
  display: none !important;
}

/* =========================================
   HEADER — Frosted Glass Premium
   ========================================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(8, 8, 10, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s ease;
}

.header-left {
  flex: 1;
}

.header-center {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #f5f5f7;
  letter-spacing: -0.02em;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  position: relative;
}

/* =========================================
   MAIN CONTENT — Premium Dark Layout
   ========================================= */
.main-content {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-content h1 {
  font-size: 36px;
  font-weight: 800;
  color: #f5f5f7;
  margin: 0;
  letter-spacing: -0.03em;
}

/* =========================================
   BUTTONS & PROFILE ICON — Premium Pill Style
   ========================================= */
.sign-in-btn {
  background: rgba(10, 132, 255, 0.9);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 980px;
  font-family: "Source Serif 4", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  letter-spacing: -0.01em;
}

.sign-in-btn:hover {
  background: rgba(10, 132, 255, 1);
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.25);
}

.sign-in-btn:active {
  transform: scale(0.97);
}

.profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background-color: #1a73e8;
  color: white;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.profile-btn:hover {
  border-color: #dadce0;
}

.profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-btn span {
  font-size: 16px;
  font-weight: 500;
}

/* =========================================
   PROFILE POPUP (Matches Images 2 & 3)
   ========================================= */
.profile-popup {
  position: absolute;
  top: 50px; /* Positioned right below the profile button */
  right: 0; /* Aligned to the right edge */
  width: 360px;
  background-color: #202124;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 16px;
  color: #e8eaed;
  z-index: 1000;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}

.popup-email {
  font-size: 13px;
  color: #9aa0a6;
  flex: 1;
  text-align: center;
}

.close-btn {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  position: absolute;
  right: 20px;
}

.close-btn:hover {
  color: #e8eaed;
}

.popup-profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.popup-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #1a73e8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
  font-size: 28px;
  border: 2px solid #ea4335; /* Google colors border representation */
}

.popup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-greeting {
  font-size: 22px;
  font-weight: 400;
  color: #e8eaed;
  margin: 0;
}

.popup-manage-section {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.manage-account-btn {
  background-color: transparent;
  border: 1px solid #5f6368;
  color: #8ab4f8;
  padding: 8px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.manage-account-btn:hover {
  background-color: rgba(138, 180, 248, 0.04);
}

/* =========================================
   DYNAMIC AUTH ACTIONS CONTAINER
   ========================================= */
#auth-actions-container {
  margin: 0 8px 8px 8px;
}

/* Single Account View */
.single-account-actions {
  display: flex;
  background-color: #2d2e30;
  border-radius: 24px;
  overflow: hidden;
}

.single-account-actions .action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: transparent;
  border: none;
  color: #e8eaed;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.single-account-actions .action-btn:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.single-account-actions .divider {
  width: 1px;
  background-color: #3c4043;
}

/* Multiple Accounts View */
.accounts-accordion {
  background-color: #2d2e30;
  border-radius: 24px;
  overflow: hidden;
}

.accordion-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  border: none;
  color: #e8eaed;
  cursor: pointer;
  transition: background-color 0.2s;
}

.accordion-toggle:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.accordion-toggle-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collapsed-avatars {
  display: flex;
}

.collapsed-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #2d2e30;
  background-color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-left: -8px;
  z-index: 10;
}

.collapsed-avatar:first-child {
  margin-left: 0;
}

.collapsed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collapsed-avatar span {
  font-size: 10px;
  color: white;
  font-weight: 500;
}

.secondary-accounts-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
  border-bottom: 1px solid #3c4043;
}

/* Custom Scrollbar for the list */
.secondary-accounts-list::-webkit-scrollbar {
  width: 8px;
}
.secondary-accounts-list::-webkit-scrollbar-track {
  background: transparent;
}
.secondary-accounts-list::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 4px;
}
.secondary-accounts-list::-webkit-scrollbar-thumb:hover {
  background: #9aa0a6;
}

.secondary-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: #e8eaed;
  transition: background-color 0.2s;
}

.secondary-account-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.secondary-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.secondary-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.secondary-account-avatar span {
  font-size: 14px;
  font-weight: 500;
  color: white;
}

.secondary-account-info {
  flex: 1;
  overflow: hidden;
}

.secondary-account-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e8eaed;
}

.secondary-account-email {
  font-size: 12px;
  color: #9aa0a6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expanded-actions .action-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  width: 100%;
  background: transparent;
  border: none;
  color: #e8eaed;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

.expanded-actions .action-btn:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

/* =========================================
   FOOTER
   ========================================= */
.popup-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  font-size: 12px;
  color: #9aa0a6;
}

.popup-footer a {
  color: #9aa0a6;
  text-decoration: none;
}

.popup-footer a:hover {
  text-decoration: underline;
}
/* =========================================
   CHANGE PROFILE PICTURE PANEL & TOOLTIP
   ========================================= */

/* Wrapper for hover effects */
.popup-profile-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}

/* Darken image on hover */
.popup-profile-wrapper:hover .popup-avatar {
  filter: brightness(0.7);
}

/* Camera icon overlay */
.camera-icon-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #3c4043;
  border: 2px solid #202124;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* Hover Tooltip */
.profile-tooltip {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #5f6368;
  color: white;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.popup-profile-wrapper:hover .profile-tooltip {
  opacity: 1;
}

/* The Right-Side Modal Panel */
/* The Blurred Backdrop */
.change-pic-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.55); /* Dark semi-transparent overlay */
  backdrop-filter: blur(5px); /* Blurs the background */
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center; /* Centers the modal perfectly */
}

/* The Centered Modal Panel */
.change-pic-modal {
  width: 320px; /* REDUCED WIDTH */
  max-width: 90vw;
  background-color: #202124;
  color: #e8eaed;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.change-pic-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #3c4043;
}

.change-pic-header h2 {
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 0 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.change-pic-body {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Large Profile Display */
.large-profile-display {
  width: 160px; /* SLIGHTLY SMALLER PROFILE PICTURE */
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 24px; /* REDUCED SPACING */
  background-color: #1a73e8;
}

.large-profile-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#large-preview-initials {
  width: 100%;
  height: 100%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

/* The Blurred Backdrop */
.change-pic-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(
    0,
    0,
    0,
    0.6
  ); /* Slightly darker for better contrast */
  backdrop-filter: blur(6px); /* Beautiful background blur */
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The Centered Modal Panel - PREMIUM DESIGN */
.change-pic-modal {
  width: 360px;
  max-width: 90vw;
  background-color: #28292c; /* Sleek, elevated dark gray */
  color: #e8eaed;
  border-radius: 24px; /* Modern, soft rounded corners */
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05); /* Deep shadow + subtle border */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.change-pic-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Very subtle separator */
}

.change-pic-header h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 0 16px;
  letter-spacing: 0.2px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.change-pic-body {
  padding: 32px 24px 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Large Profile Display - HIGH QUALITY */
.large-profile-display {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 36px;
  background-color: #1a73e8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); /* Makes the image pop off the background */
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.large-profile-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#large-preview-initials {
  width: 100%;
  height: 100%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

/* Action Buttons Grid */
.action-buttons-container {
  display: flex;
  justify-content: center;
  gap: 48px; /* Perfect spacing for exactly two buttons */
  width: 100%;
}

.action-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  text-align: center;
  gap: 12px;
}

.action-btn-wrapper span {
  font-size: 13px;
  color: #e8eaed;
  line-height: 1.4;
  font-weight: 500;
}

/* Premium Button Styling */
.circle-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #3c4043;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.circle-btn:hover {
  background-color: #4a4d51;
  transform: translateY(-2px); /* Button lifts up slightly on hover */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Camera UI Overlay */
.camera-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}
#camera-video {
  width: 100%;
  height: calc(100% - 80px);
  object-fit: cover;
}
.camera-controls {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: #000;
}
.camera-text-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
}
.capture-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: white;
  border: 4px solid #5f6368;
  cursor: pointer;
}
.capture-circle:active {
  background-color: #e8eaed;
}
/* =========================================
   SIDEBAR MENU STYLES (Premium Dark Theme)
   ========================================= */

/* Material Symbols Base Settings */
.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* The dark background overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* The Sliding Panel */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px; /* Hidden off-screen by default */
  width: 320px;
  height: 100vh;
  background-color: #1e1f22; /* Sleek Dark Theme */
  color: #e3e3e3;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth slide animation */
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  font-family: "Google Sans", Roboto, Arial, sans-serif;
}
.sidebar.active {
  left: 0; /* Slides into view */
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}
.sidebar-header .icon-btn {
  color: #e3e3e3;
}
.sidebar-header .icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 16px;
}

.sidebar-section-title {
  padding: 0 24px 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #e3e3e3;
}

/* History Items & Premium Typography */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sophisticated Hover Tooltip */
.history-item-wrapper {
  position: relative;
  padding: 0 12px;
}
.history-item-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -28px;
  left: 24px;
  background-color: #e8eaed; /* Light tooltip on dark theme */
  color: #202124;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transform: translateY(-5px);
  z-index: 10005;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.history-item-wrapper:hover::after {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s; /* Slight delay for a professional feel */
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.history-item:hover {
  background-color: #282a2c;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}
.history-item-left .material-symbols-outlined {
  font-size: 18px;
  color: #c4c7c5;
}

/* Refined Typography */
.history-text {
  font-size: 14px;
  font-weight: 500; /* Bolder, more professional */
  letter-spacing: 0.3px; /* Better spacing */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e3e3e3;
  font-family:
    "Google Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

/* Delete Menu (3 dots) */
.history-more-btn {
  opacity: 0;
  padding: 4px;
  width: 28px;
  height: 28px;
  color: #c4c7c5;
}
.history-item:hover .history-more-btn {
  opacity: 1;
}
.delete-dropdown {
  position: absolute;
  right: 24px;
  top: 36px;
  background-color: #282a2c;
  border: 1px solid #444746;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
}
.delete-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #e3e3e3;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.delete-btn:hover {
  background-color: #333538;
}
.delete-btn .material-symbols-outlined {
  font-size: 18px;
  color: #f28b82;
}

/* Search Modal Styles */
.search-modal {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 90vw;
  background-color: #28292c;
  border-radius: 12px;
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}
.search-header .material-symbols-outlined {
  color: #9aa0a6;
}
#search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e8eaed;
  font-size: 16px;
  outline: none;
  font-family: "Source Serif 4", Georgia, serif;
}
#search-input::placeholder {
  color: #9aa0a6;
}
.search-results {
  max-height: 350px;
  overflow-y: auto;
  padding: 8px 0;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  cursor: pointer;
  color: #e3e3e3;
  transition: background-color 0.2s;
}
.search-result-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Sidebar Footer (Settings) */
.sidebar-footer {
  padding: 12px;
  margin-bottom: 8px;
}
.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  color: #e3e3e3;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.sidebar-footer-btn:hover {
  background-color: #282a2c;
}

/* Settings & Help Panel */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: 10002;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.settings-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}
.settings-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: min(680px, calc(100vw - 36px));
  height: min(620px, calc(100vh - 36px));
  background: #202124;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 10003;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  opacity: 1;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
}
.settings-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #25262a;
}
.settings-kicker {
  margin: 0 0 3px;
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.settings-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}
.settings-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 0;
  flex: 1;
}
.settings-menu {
  padding: 12px;
  background: #1b1c1f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}
.settings-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #dfe3ea;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.settings-menu-item:hover,
.settings-menu-item.active {
  background: #2a2c31;
  border-color: rgba(255, 255, 255, 0.08);
}
.settings-menu-item .material-symbols-outlined {
  color: #c4c7c5;
  font-size: 21px;
}
.settings-menu-item small {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(138, 180, 248, 0.16);
  color: #a8c7fa;
  font-size: 11px;
  text-align: center;
}
.settings-detail {
  padding: 18px;
  overflow-y: auto;
  min-width: 0;
}
.settings-section-title {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: 0;
}
.settings-section-copy {
  margin: 0 0 16px;
  color: #aeb4bd;
  font-size: 13px;
  line-height: 1.55;
}
.settings-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.settings-row:first-child {
  padding-top: 0;
}
.settings-row strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}
.settings-row span,
.settings-muted {
  color: #aeb4bd;
  font-size: 12px;
  line-height: 1.45;
}
.settings-profile-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(138, 180, 248, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
}
.settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #34363c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8eaed;
  font-weight: 800;
}
.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.settings-profile-card h4 {
  margin: 0 0 3px;
  font-size: 16px;
}
.settings-profile-card p {
  margin: 0;
  color: #aeb4bd;
  font-size: 12px;
}
.settings-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(138, 180, 248, 0.14);
  color: #a8c7fa;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.settings-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: #2d2f35;
  color: #e8eaed;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.settings-action-btn:hover {
  background: #383b42;
}
.settings-action-btn.danger {
  color: #f2aaa5;
  border-color: rgba(242, 139, 130, 0.35);
  background: rgba(242, 139, 130, 0.08);
}
.settings-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}
.settings-toggle input {
  position: absolute;
  opacity: 0;
}
.settings-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #4b4d52;
  cursor: pointer;
  transition: background 0.2s ease;
}
.settings-toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.settings-toggle input:checked + span {
  background: #8ab4f8;
}
.settings-toggle input:checked + span::after {
  transform: translateX(20px);
}
.my-list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.my-list-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}
.my-list-cover,
.my-list-cover-fallback {
  width: 58px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
  background: #34363c;
}
.my-list-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8eaed;
  font-size: 12px;
  font-weight: 800;
}
.my-list-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-list-meta {
  margin: 0;
  color: #aeb4bd;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-list-actions {
  display: flex;
  gap: 6px;
}
.settings-empty {
  padding: 24px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #aeb4bd;
  text-align: center;
  font-size: 13px;
}
body.hide-continue-reading #continue-reading-section {
  display: none !important;
}
body.library-compact-mode .pdf-row {
  gap: 14px;
}
body.library-compact-mode .pdf-card {
  width: 168px;
}
body.library-reduce-motion *,
body.library-reduce-motion *::before,
body.library-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}
@media (max-width: 720px) {
  .settings-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: min(680px, calc(100vh - 20px));
  }
  .settings-shell {
    grid-template-columns: 1fr;
  }
  .settings-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
  }
  .settings-menu-item {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: 54px;
    margin: 0;
    font-size: 12px;
  }
  .settings-menu-item small {
    display: none;
  }
  .my-list-item {
    grid-template-columns: 48px 1fr;
  }
  .my-list-cover,
  .my-list-cover-fallback {
    width: 48px;
    height: 66px;
  }
  .my-list-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .settings-profile-card {
    grid-template-columns: 48px 1fr;
  }
  .settings-profile-card .settings-pill {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }
}
/* =========================================
   ULTRA-PREMIUM DARK LIBRARY DESIGN
   ========================================= */

.main-content {
  background-color: #08080a !important;
  color: #f5f5f7;
  min-height: 100vh;
}

.main-content h1 {
  color: #f5f5f7 !important;
  margin-bottom: 8px;
}

/* ── Row Container ── */
.pdf-row-container {
  margin-bottom: 2.5vw;
  width: 100%;
}


/* ── Row Title — Source Serif 4 ── */
.row-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 24px;
  color: #f5f5f7;
  font-weight: 700;
  margin: 0 4% 0.6em 4%;
  letter-spacing: -0.02em;
}

/* ── Horizontal Scroll Row ── */
.pdf-row {
  display: flex;
  overflow-x: auto;
  padding: 16px 4%;
  gap: 18px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.pdf-row::-webkit-scrollbar {
  display: none;
}

/* =========================================
   ULTRA-PREMIUM BOOK CARD
   3D hover, ambient glow, smooth slow-down
   ========================================= */
.pdf-card {
  flex: 0 0 auto;
  width: 185px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background-color: #141416;
  display: block;
  scroll-snap-align: start;
  /* PREMIUM: Multi-property transition with Apple easing */
  transition:
    transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    filter 0.4s ease;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 0 0.5px rgba(255, 255, 255, 0.04);
  will-change: transform;
}

.pdf-premium-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 18, 24, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* HOVER: Scale up + ambient glow + lift */
.pdf-card:hover {
  transform: scale(1.08) translateY(-6px);
  z-index: 10;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(10, 132, 255, 0.08),
    0 0 0 0.5px rgba(255, 255, 255, 0.1);
}

/* PRESS: Subtle scale-down for tactile feel */
.pdf-card:active {
  transform: scale(1.02) translateY(-2px);
  transition: transform 0.1s ease;
}

/* Dim other cards when one is hovered */
.pdf-row:hover .pdf-card:not(:hover) {
  filter: brightness(0.65);
  transition:
    transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
    filter 0.3s ease;
}

/* ── Thumbnail Image ── */
.pdf-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.book-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #27344c 0%, #121726 100%);
  color: rgba(223, 235, 255, 0.95);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.book-cover-fallback span {
  pointer-events: none;
}

.pdf-thumbnail-fallback {
  width: 100%;
  height: 100%;
  font-size: 28px;
}

.pdf-card:hover .pdf-thumbnail {
  transform: scale(1.04);
}

/* ── Info Overlay (appears on hover) ── */
.pdf-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.5) 55%,
    transparent 100%
  );
  padding: 24px 14px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pdf-card:hover .pdf-info {
  opacity: 1;
  transform: translateY(0);
}

/* ── Title on Card ── */
.pdf-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* ── Author on Card ── */
.pdf-author {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-weight: 400;
}

/* =========================================
   CINEMATIC MODAL (WHITE THEME)
   ========================================= */
.cinematic-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cinematic-modal {
  width: 850px;
  max-width: 95vw;
  height: 85vh;
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.2);
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-cinematic-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #202124;
  width: 36px;
  height: 36px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-cinematic-btn:hover {
  background-color: #ffffff;
}

.cinematic-hero {
  position: relative;
  width: 100%;
  height: 100%;
}

.cinematic-media {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: none; /* Removes iframe borders */
  transition: opacity 0.8s ease;
}
.cinematic-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      #ffffff 0%,
      rgba(255, 255, 255, 0.8) 30%,
      transparent 70%
    ),
    linear-gradient(
      to right,
      #ffffff 0%,
      rgba(255, 255, 255, 0.9) 35%,
      transparent 60%
    );
  pointer-events: none;
}

.cinematic-content {
  position: absolute;
  bottom: 10%;
  left: 40px;
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}

.cinematic-title {
  font-size: 42px;
  font-weight: 800;
  color: #202124;
  margin: 0;
  line-height: 1.1;
}

.cinematic-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

.match-text {
  color: #188038;
  font-weight: bold;
}
.age-rating {
  border: 1px solid #dadce0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #5f6368;
}
.category-tag {
  color: #5f6368;
}

.cinematic-desc {
  font-size: 16px;
  color: #3c4043;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cinematic-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.primary-play-btn {
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px 10px 16px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
}

.primary-play-btn:hover {
  background-color: #1557b0;
  transform: translateY(-1px);
}

.secondary-circle-btn {
  background-color: white;
  color: #5f6368;
  border: 1px solid #dadce0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-circle-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background-color: #f8f9fa;
}

/* =========================================
   HOME UPGRADE: SEARCH + CONTINUE + PROFILE
   ========================================= */

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
}

.header-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  min-width: 300px;
  max-width: min(48vw, 430px);
  padding: 0 15px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.06);
  color: #e8eaed;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.header-search-pill:hover {
  border-color: rgba(147, 197, 253, 0.42);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 32px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-search-pill .material-symbols-outlined {
  font-size: 19px;
  opacity: 0.86;
}

.header-search-pill span:nth-child(2) {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-search-pill kbd {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 2px;
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.site-premium-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 132px;
  max-width: 168px;
  padding: 0 16px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.24);
  cursor: pointer;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.site-premium-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.32);
}

.site-premium-btn:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.92);
  outline-offset: 3px;
}

.site-premium-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.site-premium-btn .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 20px;
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.site-premium-btn span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-btn {
  height: 42px;
  width: auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 9px;
  overflow: visible;
  max-width: 190px;
}

.profile-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.profile-btn #profile-img,
.profile-btn #profile-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-btn #profile-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8, #4f9cff);
  color: #fff;
  font-size: 12px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.profile-name {
  color: #f5f5f7;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   TRAINING MEGA MENU (APPLE-STYLE INSPIRED)
   ========================================= */

.training-mega-shell {
  width: min(1120px, 92%);
  margin: 8px auto 28px;
  position: relative;
  z-index: 46;
}

.training-nav-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 19, 24, 0.84);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  overflow-x: auto;
  scrollbar-width: none;
}

.training-nav-bar::-webkit-scrollbar {
  display: none;
}

.training-nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(240, 245, 255, 0.84);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.training-nav-item:hover,
.training-nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  outline: none;
}

.training-nav-item.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.training-mega-backdrop {
  position: fixed;
  top: 124px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 10, 14, 0.52);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.training-mega-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(20, 22, 30, 0.96);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  max-height: 0;
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    transform 0.26s ease,
    max-height 0.3s ease;
  z-index: 3;
}

.training-mega-shell.open .training-mega-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.training-mega-shell.open .training-mega-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  max-height: 680px;
  pointer-events: auto;
}

.training-panel-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 28px;
  padding: 24px 26px 26px;
}

.training-panel-eyebrow {
  margin: 0 0 8px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: rgba(205, 214, 235, 0.62);
  letter-spacing: 0.24px;
}

.training-panel-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.training-panel-link {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  color: rgba(239, 245, 255, 0.9);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 36px;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.training-panel-link:hover,
.training-panel-link:focus-visible {
  color: #ffffff;
  transform: translateX(3px);
  outline: none;
}

.training-panel-link.active {
  color: #ffffff;
}

.training-panel-books-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.training-panel-books-head h2 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 29px;
  color: #f5f8ff;
  letter-spacing: -0.02em;
}

.training-panel-books-head p {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  color: rgba(206, 214, 232, 0.68);
}

.training-book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.training-book-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #171922;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease,
    opacity 0.25s ease;
}

.training-book-card:hover,
.training-book-card:focus-visible {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(157, 189, 255, 0.5);
  box-shadow: 0 16px 34px rgba(5, 7, 11, 0.5);
  outline: none;
}

.training-book-grid:hover .training-book-card:not(:hover) {
  filter: brightness(0.64) saturate(0.84);
  opacity: 0.76;
}

.training-book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.training-book-cover-fallback {
  width: 100%;
  aspect-ratio: 2 / 3;
  font-size: 24px;
}

.training-book-title {
  display: block;
  padding: 8px 9px 9px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #e8edf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(180deg, rgba(23, 25, 34, 0.7), rgba(14, 15, 20, 0.96));
}

.continue-reading-section {
  width: 92%;
  margin: 0 auto 28px;
}

.continue-reading-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.continue-reading-head .row-title {
  margin: 0;
}

.continue-reading-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.continue-reading-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.continue-reading-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(145deg, rgba(24, 25, 30, 0.9), rgba(14, 14, 18, 0.95));
  border-radius: 16px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 70px 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "cover meta"
    "time time";
  gap: 10px 12px;
  padding: 10px 12px;
  width: 100%;
  cursor: pointer;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  position: relative;
}

.continue-reading-card:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 171, 255, 0.42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.continue-cover {
  grid-area: cover;
  width: 70px;
  height: 98px;
  border-radius: 10px;
  object-fit: cover;
  background: #111;
}

.continue-cover-fallback {
  grid-area: cover;
  width: 70px;
  height: 98px;
  border-radius: 10px;
  font-size: 22px;
}

.continue-meta {
  grid-area: meta;
  min-width: 0;
  padding-right: 16px;
}

.continue-meta h3 {
  margin: 1px 0 4px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1.2;
}

.continue-meta p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.62);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.continue-progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.continue-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ea5ff, #90cffc);
}

.continue-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
}

.continue-time-wrap {
  grid-area: time;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 18px;
}

.continue-time {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  display: inline-block;
  line-height: 1;
}

.continue-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 13, 18, 0.72);
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.continue-remove-btn .material-symbols-outlined {
  font-size: 16px;
}

.continue-reading-card:hover .continue-remove-btn,
.continue-reading-card:focus-within .continue-remove-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.continue-remove-btn:hover {
  background: rgba(224, 77, 95, 0.2);
  border-color: rgba(224, 77, 95, 0.5);
  color: #ffd7dc;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.58);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  opacity: 0;
  pointer-events: none;
  z-index: 10010;
  transition: opacity 0.18s ease;
}

.search-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.98);
  width: min(850px, 94vw);
  max-height: min(78vh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 17, 24, 0.94);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  pointer-events: none;
  z-index: 10011;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f4f7fb;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.35;
  outline: none;
}

#search-input::placeholder {
  color: rgba(233, 237, 245, 0.42);
}

.search-esc {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-bottom-width: 2px;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.search-subtext {
  margin: 0;
  padding: 9px 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.search-results {
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-empty-state {
  padding: 16px;
  color: rgba(255, 255, 255, 0.64);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.search-count-hint {
  padding: 10px 14px 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.46);
}

.rich-search-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  padding: 10px;
  text-align: left;
  color: #f4f7fb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rich-search-item:hover {
  border-color: rgba(131, 178, 255, 0.42);
  background: rgba(131, 178, 255, 0.08);
}

.search-result-cover {
  width: 52px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  background: #101114;
}

.search-result-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #27344c 0%, #121726 100%);
  color: rgba(223, 235, 255, 0.95);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.search-result-main {
  min-width: 0;
}

.search-result-main strong {
  display: block;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-main p {
  margin: 4px 0 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-main small {
  display: block;
  margin-top: 7px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  color: rgba(174, 214, 255, 0.9);
}

.search-premium-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.search-result-open {
  align-self: center;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.84);
}

@media (max-width: 1100px) {
  .header-search-pill {
    min-width: 230px;
  }

  .training-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .training-panel-link {
    font-size: 30px;
  }
}

@media (max-width: 860px) {
  .header {
    padding: 12px 14px;
    gap: 10px;
  }

  .header-center {
    font-size: 18px;
  }

  .header-search-pill {
    min-width: 160px;
    max-width: 42vw;
  }

  .header-search-pill kbd {
    display: none;
  }

  .profile-name {
    max-width: 75px;
  }

  .site-premium-btn {
    min-width: 118px;
    max-width: 138px;
    padding: 0 12px;
  }

  .continue-reading-list {
    grid-template-columns: 1fr;
  }

  .training-mega-shell {
    width: 96%;
  }

  .training-panel-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .training-panel-link {
    font-size: 28px;
  }

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

  .training-panel-books-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .header-search-pill {
    display: none;
  }

  .site-premium-btn {
    min-width: 42px;
    width: 42px;
    padding: 0;
    border-radius: 50%;
  }

  .site-premium-btn span:last-child {
    display: none;
  }

  .search-modal {
    top: 70px;
    width: 95vw;
    max-height: 82vh;
  }

  #search-input {
    font-size: 17px;
  }

  .training-nav-item {
    padding: 8px 11px;
    font-size: 13px;
  }

  .training-panel-layout {
    padding: 16px;
  }

  .training-panel-link {
    font-size: 24px;
  }

  .training-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
