* { box-sizing: border-box; }
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      font-family: 'Segoe UI', sans-serif;
      background: #121212;
      color: #fff;
      overflow: hidden;
    }
    #top-bar {
      width: 100%;
      padding: 10px 15px;
      background: #1f1f1f;
      color: white;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    #controls, #page-controls {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    button {
      padding: 8px 14px;
      font-size: 14px;
      cursor: pointer;
      background: #ff007f;
      color: white;
      border: none;
      border-radius: 6px;
      transition: 0.2s;
    }
    button:hover {
      background: #ff3399;
    }
button:disabled {
  background-color: #aaa;
  color: #666;
  border: 1px solid #888;
  cursor: not-allowed;
  opacity: 0.6;
  transition: all 0.2s ease;
  position: relative;
}

button:disabled:hover::before {
  content: "This button is unavailable because you need to upload a file first.";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

button:disabled:hover::before {
  opacity: 1;
  visibility: visible;
}

button:enabled:hover::before {
  opacity: 0;
  visibility: hidden;
}

    input[type="number"] {
      padding: 6px;
      width: 70px;
      border-radius: 4px;
      border: none;
    }
    input[type="file"] {
      background: #333;
      padding: 6px;
      border-radius: 4px;
      color: white;
    }
    #viewer-container {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      height: calc(100% - 70px);
      overflow: hidden;
    }
    .page-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;
      width: 100%;
      height: 100%;
      flex-direction: row;
      flex-wrap: wrap;
    }
    canvas {
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    }

    #page-num {
      font-size: 14px;
      color: #ccc;
      white-space: nowrap;
    }
#settings-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#settings-modal.visible {
  opacity: 1;
}

#settings-modal .modal-content {
  background: #1f1f1f;
  padding: 30px;
  border-radius: 15px;
  width: 400px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#settings-modal.visible .modal-content {
  transform: translateY(0);
  opacity: 1;
}

#settings-modal h2 {
  margin: 0;
  color: #ff007f;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 2px solid #ff007f;
  padding-bottom: 10px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.settings-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 14px;
  color: #fff;
}

#settings-modal select,
#settings-modal input[type="range"] {
  background: #333;
  border: none;
  padding: 8px;
  border-radius: 6px;
  color: white;
  width: 150px;
  transition: background 0.3s ease;
}

#settings-modal input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
}

#settings-modal input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #ff007f;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#settings-modal input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

#settings-modal input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

#settings-modal button {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

#close-settings {
  background: transparent;
  border: 2px solid #ff007f;
  color: #ff007f;
}

#close-settings:hover {
  background: rgba(255, 0, 127, 0.1);
}

#reset-settings {
  background: #333;
  color: white;
}

#reset-settings:hover {
  background: #444;
}

#theme-toggle {
  background: white;
  color: black;
  border: 1px solid #ccc;
  padding: 5px;
  border-radius: 5px;
  font-size: 14px;
}

body.light-theme #theme-toggle {
  background: #f0f0f0;
  color: #333;
}

/* Make buttons black when on light mode */
body.light-theme button {
  background: #000000;
  color: white;
}

body.light-theme button:hover {
  background: #333333;
}

/* Keep the settings button style consistent */
body.light-theme #close-settings {
  background: transparent;
  border: 2px solid #000000;
  color: #000000;
}

body.light-theme #close-settings:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.light-theme #theme-toggle {
  background: #000000;
  border: 2px solid #000000;
}

/* Keep disabled button styles consistent */
body.light-theme button:disabled {
  background-color: #ddd;
  color: #888;
  border: 1px solid #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#theme-toggle::before {
  content: '🌙';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  transition: all 0.3s;
}

#theme-toggle.light::before {
  content: '☀️';
  left: 35px;
}
    body.light-theme {
  background: #f4f4f4;
  color: #111;
}

body.light-theme #top-bar {
  background: #e0e0e0;
  color: #111;
}

body.light-theme #settings-modal .modal-content {
  background: #ffffff;
  color: #333333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.light-theme .settings-group {
  background: rgba(0, 0, 0, 0.05);
}

body.light-theme .settings-group label {
  color: #333333;
}

body.light-theme #settings-modal select,
body.light-theme #settings-modal input[type="range"] {
  background: #ffffff;
  border: 1px solid #dddddd;
  color: #333333;
}

body.light-theme #settings-modal input[type="range"] {
  background: #dddddd;
}

body.light-theme #settings-modal input[type="range"]::-webkit-slider-thumb {
  background: #ff007f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.light-theme #theme-toggle {
  background: #e0e0e0;
  border: 2px solid #ff007f;
}

body.light-theme #theme-toggle::before {
  filter: none; /* Ensures emoji is visible */
}

/* Reset and close buttons in light mode */
body.light-theme #reset-settings {
  background: #ff007f;
  color: white;
}

body.light-theme #reset-settings:hover {
  background: #ff3399;
}

body.light-theme #close-settings {
  background: transparent;
  border: 2px solid #ff007f;
  color: #ff007f;
}

body.light-theme #close-settings:hover {
  background: rgba(255, 0, 127, 0.1);
}

/* Scale value text in light mode */
body.light-theme #scale-value {
  color: #333333;
}

#scale-value {
  transition: all 0.2s ease;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}

#scale-value.active {
  background: rgba(255, 0, 127, 0.1);
  color: #ff007f;
}

/* Light theme adjustments */
body.light-theme #settings-modal input[type="range"]:active::-webkit-slider-thumb {
  box-shadow: 0 0 10px rgba(80, 80, 80, 0.3);
}

body.light-theme #scale-value.active {
  background: rgba(80, 80, 80, 0.1);
  color: #505050;
}

/* Settings groups title in light mode */
body.light-theme #settings-modal h2 {
  color: #ff007f;
  border-bottom-color: #ff007f;
}

body.light-theme canvas {
  background: #fff;
}

body.light-theme input[type="file"],
body.light-theme input[type="number"] {
  background: #fff;
  color: #000;
}
 
/* tghe new floating controls styles */
#floating-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#floating-controls.visible {
  opacity: 1;
  transform: translateY(0);
}

#floating-controls button,
#floating-settings {
  background: #ff007f;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#floating-settings {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#floating-settings.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover effects */
#floating-controls button:hover,
#floating-settings:hover {
  background: #ff3399;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* Press animation */
#floating-controls button:active,
#floating-settings:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Ripple effect */
#floating-controls button::after,
#floating-settings::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: width 0.3s ease-out, height 0.3s ease-out, opacity 0.3s ease-out;
}

#floating-controls button:active::after,
#floating-settings:active::after {
  width: 100px;
  height: 100px;
  opacity: 1;
  transition: 0s;
}

/* Light theme adjustments */
body.light-theme #floating-controls button,
body.light-theme #floating-settings {
  background: #505050;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.light-theme #floating-controls button:hover,
body.light-theme #floating-settings:hover {
  background: #666666;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

button.hidden {
  display: none;
}

.drop-zone {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border: 2px dashed #ff007f;
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
  gap: 40px;
  cursor: pointer; /* Add cursor pointer to indicate clickable area */
  transform-origin: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drop-zone .content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.drop-zone.dragover {
  background: rgba(255, 0, 127, 0.1);
  border-color: #ff3399;
  transform: scale(1.02);
  /* removing since its ruining the zoomin effect
  add back to shake drop zone when dragover
  animation: pulseAndBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); */
}
/* removing since its ruining the zoomin effect add back to shake drop zone when dragover
@keyframes pulseAndBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  65% {
    transform: scale(0.98);
  }
  80% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
} */

.drop-zone::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 15px;
  background: rgba(255, 0, 127, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.drop-zone.dragover::after {
  background: rgba(255, 0, 127, 0.1);
}

body.light-theme .drop-zone.dragover::after {
  background: rgba(80, 80, 80, 0.1);
}

.drop-zone .text {
  font-size: 32px;
  margin: 0 0 20px 0;
  color: #ff007f;
  font-weight: 600;
}

/* Add media query for mobile devices */
@media (max-width: 768px) {
  .drop-zone { /* THIS IS MOBILE ONLY. */
    flex-direction: column;  /* Stack vertically on mobile */
  }
  
  .drop-zone .content-wrapper { /* THIS IS MOBILE ONLY. */
    margin-right: 0;
    margin-bottom: 20px;
    align-items: center;  /* Center align on mobile */
  }
  
  .drop-zone .text { /* THIS IS MOBILE ONLY. */
    text-align: center;
  }
}
/* End of media query */

.drop-zone .text {
  font-size: 28px;
  margin: 10px 0;
  color: #ff007f;
  font-weight: 600;
}

.drop-zone button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  align-self: flex-start;
}

#file-input {
  display: none;
}

.drop-zone .icon svg {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 8px 16px rgba(255, 0, 127, 0.2));
  animation: pulse 3s ease-in-out infinite;
}

.drop-zone .text {
  font-size: 28px;
  margin: 25px 0;
  color: #ff007f;
  font-weight: 600;
}

.drop-zone button {
  margin-top: 15px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
}
/* The float animation has been replaced with pulse but I kept it here in case I want to use it again later. */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.page-wrapper canvas {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.page-wrapper canvas.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Add animation for page exit */
.page-wrapper canvas.exit {
  opacity: 0;
  transform: translateX(-20px);
}

.error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff007f;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 1000;
  animation: fadeInOut 2s ease-in-out forwards;
  /* removing because its too hard to read the text
  add this line back if you want the shake animation on the error message */
  /*
  animation: fadeInOutShake 2s ease-in-out forwards;
  */
}

@keyframes fadeInOutShake {
  0% { 
    opacity: 0; 
    transform: translate(-50%, -20px); 
  }
  15% { 
    opacity: 1; 
    transform: translate(-50%, 0); 
  }
  20%, 22%, 24% {
    transform: translate(-52%, 0);
  }
  21%, 23%, 25% {
    transform: translate(-48%, 0);
  }
  26% {
    transform: translate(-50%, 0);
  }
  85% { 
    opacity: 1; 
    transform: translate(-50%, 0); 
  }
  100% { 
    opacity: 0; 
    transform: translate(-50%, -20px); 
  }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -20px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* Update light mode colors */
body.light-theme button {
  background: #505050;  /* Softer gray instead of black */
  color: white;
}

body.light-theme button:hover {
  background: #666666;
}

/* Update settings modal colors in light mode */
body.light-theme #settings-modal h2 {
  color: #505050;
  border-bottom-color: #505050;
}

body.light-theme #reset-settings {
  background: #505050;
  color: white;
}

body.light-theme #reset-settings:hover {
  background: #666666;
}

body.light-theme #close-settings {
  background: transparent;
  border: 2px solid #505050;
  color: #505050;
}

body.light-theme #close-settings:hover {
  background: rgba(80, 80, 80, 0.1);
}

/* Update drop zone colors in light mode */
body.light-theme .drop-zone {
  border-color: #505050;
}

body.light-theme .drop-zone .text {
  color: #505050;
}

body.light-theme .drop-zone .icon svg {
  stroke: #505050;  /* Update SVG color */
  filter: drop-shadow(0 8px 16px rgba(80, 80, 80, 0.2));
}

body.light-theme .drop-zone.dragover {
  background: rgba(80, 80, 80, 0.1);
  border-color: #666666;
}

/* Update error message in light mode */
body.light-theme .error-message {
  background: #505050;
}

/* Update theme toggle in light mode */
body.light-theme #theme-toggle {
  background: #505050;
  border: 2px solid #505050;
}

/* Update floating controls in light mode */
body.light-theme #floating-controls button,
body.light-theme #floating-settings {
  background: #505050;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.light-theme #floating-controls button:hover,
body.light-theme #floating-settings:hover {
  background: #666666;
}

/* Update SVG colors in light mode */
body.light-theme .drop-zone .icon svg rect,
body.light-theme .drop-zone .icon svg path {
  stroke: #505050;
}

/* Default (dark mode) SVG styling */
.drop-zone .icon svg rect,
.drop-zone .icon svg path {
  stroke: #ff007f;  /* Pink color for dark mode */
}

/* Light mode SVG styling */
body.light-theme .drop-zone .icon svg rect,
body.light-theme .drop-zone .icon svg path {
  stroke: #505050;  /* Gray color for light mode */
}

/* Update the filter for both modes */
.drop-zone .icon svg {
  filter: drop-shadow(0 8px 16px rgba(255, 0, 127, 0.2));  /* Pink shadow for dark mode */
}

body.light-theme .drop-zone .icon svg {
  filter: drop-shadow(0 8px 16px rgba(80, 80, 80, 0.2));  /* Gray shadow for light mode */
}

/* Update range input styling in light mode */
body.light-theme #settings-modal input[type="range"] {
  background: #e0e0e0;
}

body.light-theme #settings-modal input[type="range"]::-webkit-slider-thumb {
  background: #505050;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.light-theme #settings-modal input[type="range"]::-webkit-slider-thumb:hover {
  background: #666666;
}

/* Update the scale value text color */
body.light-theme #scale-value {
  color: #505050;
}

/* Default (dark mode) page number styling */
#page-num {
  font-size: 14px;
  color: #ccc;
  white-space: nowrap;
}

/* Light mode page number styling */
body.light-theme #page-num {
  color: #000000;
}

/* Update input styling for light mode */
body.light-theme input[type="number"] {
  background: #505050;
  color: white;
  border: 1px solid #666666;
}

body.light-theme input[type="number"]:focus {
  outline: none;
  border-color: #666666;
  box-shadow: 0 0 0 2px rgba(80, 80, 80, 0.2);
}

#upload-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect */
#upload-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
}

/* Ripple effect */
#upload-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

#upload-btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.5;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

/* Light theme adjustments */
body.light-theme #upload-btn:hover {
  box-shadow: 0 0 20px rgba(80, 80, 80, 0.3);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  backface-visibility: hidden;
  transform-origin: center;
}

input[type="number"].invalid {
  border: 2px solid #ff007f;
  background-color: rgba(255, 0, 127, 0.1);
}

/* Light theme styling for invalid input */
body.light-theme input[type="number"].invalid {
  border: 2px solid #ff0000;
  background-color: rgba(255, 0, 0, 0.1);
}

#logout-btn {
  background: #ff3b3b;
  color: #fff;
}
#logout-btn:hover {
  background: #ff5555;
}

/* Cloud storage UI styles */
.cloud-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cloud-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #23262f;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  max-width: 90%;
  width: 400px;
}

.cloud-menu.visible {
  display: block;
}

.cloud-menu h2 {
  color: #ff007f;
  margin-bottom: 1rem;
}

.cloud-file-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 1rem 0;
}

.cloud-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cloud-file-item button {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
}

/* Google Drive UI styles */
.drive-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #23262f;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  max-width: 90%;
  width: 400px;
}

.drive-menu.visible {
  display: block;
}

.drive-menu h2 {
  color: #ff007f;
  margin-bottom: 1rem;
}

.drive-file-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 1rem 0;
}

.drive-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drive-file-item button {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

body.light-theme .cloud-menu {
  background: #fff;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);
}

body.light-theme .cloud-file-item {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .drive-menu {
  background: #fff;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);
}

body.light-theme .drive-file-item {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
    .success-message {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      background-color: #4CAF50;
      color: white;
      padding: 15px 30px;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.2);
      z-index: 1000;
      animation: slide-down 0.3s ease-out;
    }

    @keyframes slide-down {
      0% { transform: translate(-50%, -100%); opacity: 0; }
      100% { transform: translate(-50%, 0); opacity: 1; }
    }

/* Style the toolbar hiding checkbox */
#hide-toolbar-toggle {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

#hide-toolbar-toggle:checked {
  background: #ff007f;
  border-color: #ff007f;
}

/* Light theme styles */
body.light-theme #hide-toolbar-toggle {
  background: #f0f0f0;
  border-color: #ddd;
}

body.light-theme #hide-toolbar-toggle:checked {
  background: #333;
  border-color: #333;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.visible {
    display: flex !important;
}

.loading-overlay p {
    color: white;
    font-size: 16px;
    margin: 0;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: #ff007f;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

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

/* Light theme */
body.light-theme .loading-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-theme .loading-overlay p {
    color: #333;
}

body.light-theme .loader {
    border: 5px solid #333;
    border-bottom-color: #ff007f;
}

.annotation-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.95);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.annotation-toolbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(100px);
}

.annotation-toolbar button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1.2em;
  transition: all 0.2s ease;
}

.annotation-toolbar button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.annotation-toolbar button.active {
  background: #48c6ef;
}

.annotation-toolbar input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.annotation-toolbar input[type="range"] {
  width: 100px;
  cursor: pointer;
}

.annotation-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background: #48c6ef;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

.annotation-canvas {
  position: absolute !important;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2;
  touch-action: none;
}

.annotation-canvas.active {
  pointer-events: all;
}

/* Disable user selection when drawing */
.drawing {
  user-select: none;
  -webkit-user-select: none;
}

/* Fix some mobile-specific issues */
@media (max-width: 768px) {
  .annotation-toolbar {
    padding: 8px;
    gap: 8px;
    bottom: 80px; /* Move up to avoid overlap with floating controls */
  }
  
  .annotation-toolbar button {
    width: 36px;
    height: 36px;
    font-size: 1em;
  }
  
  .annotation-toolbar input[type="range"] {
    width: 60px;
  }
  
  .annotation-toggle {
    bottom: 80px;
  }
}

.page-canvas-wrapper {
  position: relative;
  margin: 10px 0;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure PDF pages and annotations align properly */
.page-canvas-wrapper canvas {
  display: block;
  margin: 0;
  padding: 0;
}

/* Position annotation canvas exactly over PDF canvas */
.page-canvas-wrapper .annotation-canvas {
  position: absolute !important;
  top: 0;
  left: 0;
  pointer-events: none;
}

.premium-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  animation: premium-glow 1.5s infinite alternate;
}
.premium-message > div {
  background: linear-gradient(135deg, #fffbe6 0%, #fff8dc 100%);
  padding: 2.5rem 2.5rem 2.2rem 2.5rem;
  border-radius: 24px;
  max-width: 440px;
  box-shadow: 0 8px 40px #bfa14a88, 0 2px 0 #fffbe6 inset, 0 0 0 4px #ffd70044;
  text-align: center;
  position: relative;
  border: 3px solid #ffd700;
  color: #7a5c00;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  overflow: visible;
}
.premium-message > div::before {
  content: '👑';
  font-size: 2.5rem;
  position: absolute;
  top: -1.7rem;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 8px #ffd70088);
  animation: premium-crown 1.2s infinite alternate;
}
@keyframes premium-glow {
  from { box-shadow: 0 8px 40px #bfa14a88, 0 2px 0 #fffbe6 inset, 0 0 0 4px #ffd70044; }
  to { box-shadow: 0 12px 60px #ffd700cc, 0 2px 0 #fffbe6 inset, 0 0 0 8px #ffd70066; }
}
@keyframes premium-crown {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.12) rotate(-6deg); }
}
.premium-message .premium-title {
  font-size: 1.5em;
  font-weight: 900;
  color: #bfa14a;
  margin-bottom: 0.7em;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px #ffd70044;
}
.premium-message .premium-btn {
  background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
  color: #7a5c00;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1em;
  padding: 0.8em 2.2em;
  margin-top: 1.2em;
  box-shadow: 0 2px 12px #ffd70055;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.premium-message .premium-btn:hover {
  background: linear-gradient(90deg, #ffe066 0%, #ffd700 100%);
  box-shadow: 0 4px 24px #ffd70099;
  transform: scale(1.05);
}
.premium-message ul {
  margin: 1.5em auto 1em auto;
  padding: 0 0 0 1.2em;
  text-align: left;
  max-width: 350px;
  color: #7a5c00;
  font-size: 1.08em;
  font-weight: 500;
}
.premium-message li {
  margin-bottom: 0.7em;
  position: relative;
  padding-left: 1.2em;
}
.premium-message li::before {
  content: '✨';
  position: absolute;
  left: 0;
  color: #ffd700;
  font-size: 1.1em;
  filter: drop-shadow(0 0 4px #ffd70088);
}