/* =====================================================
   Theme Variables & Transitions
===================================================== */
:root {
  /* Light mode colors using blue tones */
  --bg-color: radial-gradient(circle at 20% 80%,
      /* Position of the first glow (bottom-left area) */
      hsla(0, 0%, 67%, 0.75) 0%,
      /* More visible pure light sky blue glow */
      hsla(0, 0%, 100%, 0.5) 30%,
      /* Slightly more diffused pure light blue */
      hsla(0, 0%, 100%, 0) 70%
      /* Fades to transparent pure white base */
    ),
    radial-gradient(circle at 80% 20%,
      /* Position of the second glow (top-right area) */
      hsla(0, 0%, 63%, 0.6) 0%,
      /* More visible pure lighter sky blue glow */
      hsla(210, 100%, 95%, 0.35) 30%,
      /* More diffused pure light blue */
      hsla(0, 0%, 100%, 0) 70%
      /* Fades to transparent pure white base */
    ),
    radial-gradient(circle at 50% 50%,
      /* A central, very subtle glow */
      hsla(220, 100%, 90%, 0.4) 0%,
      /* More visible pure very light subtle blue glow */
      hsla(0, 0%, 100%, 0) 60%
      /* Fades to transparent pure white base */
    ),
    #FFFFFF;
  /* Base pure white color */



  --primary-color: #ffffff;
  /* Pure white for main content areas (folders, nav bar) for crispness */
  --text-color: #333333;
  /* Soft dark grey for main text, easier on eyes than pure black */
  --nav-bg: rgba(255, 255, 255, 0.1);
  /* Slightly transparent pure white for a clean, airy navigation bar */
  --toggle-bg: #f8fcfd;
  /* Very light, almost white blue for toggle backgrounds/hover states */
  --toggle-icon-color: #555555;
  /* Mid-grey for subtle yet visible icons */
  --folder-bg: linear-gradient(to bottom right,
      /* Direction of the gradient */
      hsla(200, 100%, 90%, 0.1) 0%,
      /* Very light sky blue, highly transparent */
      hsla(0, 0%, 100%, 0) 50%
      /* Fades to transparent pure white in the middle */
    ),
    linear-gradient(to top left,
      /* Another linear gradient for subtle depth */
      hsla(210, 100%, 85%, 0.08) 0%,
      /* Slightly different light blue, more transparent */
      hsla(0, 0%, 100%, 0) 50%
      /* Fades to transparent pure white */
    ),
    #cecfcfa3;
  /* Base folder background color, your original #cecfcfa3 */
  --folder-text: #333333;
  --folder-text-light: #333333b3;
  /* Soft dark grey for folder names, consistent with main text */
  --star-color: #FFD700;
  /* Gold for the star icon, making it pop without being garish */
  --border-color: #6b6b6bb7;
  /* Light grey for subtle borders on containers/elements */
  --transition-time: 0.5s;
  --reverse: 0;
  --normal: 1;

  /* Button theme variables for light mode */
  --button-view-bg: #8181814e;
  --button-download-bg: #55555567;
  /* A calm, slightly desaturated teal/cyan for secondary actions, cohesive with blue */
  --button-text-color: #ffffff;
  /* White text for contrast on colored buttons */

  /* Textbox colors for light mode */
  --textbox-user: rgba(230, 245, 255, 0.9);
  /* Very light blue, soft for user input */
  --textbox-bot: rgba(220, 235, 250, 0.9);
  /* Slightly different very light blue for bot output, subtle distinction */
  --gradient: linear-gradient(90deg,
      rgba(0, 0, 0, 0) 0%,
      /* Fully transparent at the very start */
      rgba(0, 0, 0, 0.1) 25%,
      /* Slightly visible as it approaches center */
      rgba(0, 0, 0, 0.8) 50%,
      /* Much darker/thicker in the center */
      rgba(0, 0, 0, 0.1) 75%,
      /* Tapers off again */
      rgba(0, 0, 0, 0) 100%);
  --cursor: url('CursorLight.png'), auto;
}

[data-theme="dark"] {
  /* Dark mode using only the second theme’s shades */
  --bg-color: radial-gradient(circle at 20% 80%,
      /* Position of the first glow (bottom-left area) */
      rgba(50, 50, 50, 0.625) 0%,
      /* Increased opacity from 0.4 to 0.5 (40*1.25) */
      rgba(30, 30, 30, 0.25) 30%,
      /* Increased opacity from 0.2 to 0.25 (20*1.25) */
      rgba(0, 0, 0, 0) 70%),
    radial-gradient(circle at 80% 20%,
      /* Position of the second glow (top-right area) */
      rgba(60, 60, 60, 0.375) 0%,
      /* Increased opacity from 0.3 to 0.375 (30*1.25) */
      rgba(40, 40, 40, 0.1875) 30%,
      /* Increased opacity from 0.15 to 0.1875 (15*1.25) */
      rgba(0, 0, 0, 0) 70%),
    radial-gradient(circle at 50% 50%,
      /* A central, very subtle glow */
      rgba(20, 20, 20, 0.125) 0%,
      /* Increased opacity from 0.1 to 0.125 (10*1.25) */
      rgba(0, 0, 0, 0) 60%),
    #111;
  /* Base very dark gray/near black color */



  --primary-color: #fff;
  /* Main text color */
  --text-color: #fff;
  /* Consistent with primary text */
  --nav-bg: rgba(102, 102, 102, 0.1);
  /* Semi-transparent accent (from accent-color) */
  --toggle-bg: rgba(102, 102, 102, 0.8);
  /* Matching toggle background */
  --toggle-icon-color: #fff;
  /* Light icons for contrast */
  --folder-bg: linear-gradient(to bottom right,
      /* Direction of the gradient */
      rgba(40, 40, 40, 0.15) 0%,
      /* Dark gray, highly transparent */
      rgba(0, 0, 0, 0) 50%
      /* Fades to transparent black in the middle */
    ),
    linear-gradient(to top left,
      /* Another linear gradient for subtle depth */
      rgba(30, 30, 30, 0.1) 0%,
      /* Darker gray, more transparent */
      rgba(0, 0, 0, 0) 50%
      /* Fades to transparent black */
    ),
    #27272793;
  /* Base folder background color, your original #27272793 */
  --folder-text: #fff;
  --folder-text-light: #ffffff97;
  --border-color: #d0d0d08f;
  --transition-time: 0.3s;
  /* Transition speed from the second theme */
  --reverse: 1;
  --normal: 0;
  /* Button theme variables for light mode */
  --button-view-bg: #ffffff7e;
  --button-download-bg: #d4d4d460;
  --button-text-color: #000000;
  /* White */

  --textbox-user: rgba(82, 82, 82, 0.9);
  /* User textbox color (dark) */
  --textbox-bot: rgba(72, 72, 72, 0.9);
  /* Bot textbox color (dark) */

  --gradient: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      /* Fully transparent at the very start */
      rgba(255, 255, 255, 0.1) 25%,
      /* Slightly visible as it approaches center */
      rgba(255, 255, 255, 0.8) 50%,
      /* Much brighter/thicker in the center */
      rgba(255, 255, 255, 0.1) 75%,
      /* Tapers off again */
      rgba(255, 255, 255, 0) 100%
      /* Fully transparent at the very end */

    );
  --cursor: url('CursorDark.png'), auto;
}

html,
body {
  /* Target both html and body for full height */
  min-height: 100%;
  /* Ensure both take up 100% of the viewport height */
  margin: 0;
  /* Important to reset default browser margin */
  padding: 0;
  /* Important to reset default browser padding */
}

/* Apply theme colors */
* {
  cursor: var(--cursor) !important;
}

body {
  font-family: 'Noto Serif', 'Times New Roman', Times, serif;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background var(--transition-time) ease, color var(--transition-time) ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 100%;
  cursor: var(--cursor) !important;
}

/* =====================================================
   Navbar (Transparent with Theme Toggle)
===================================================== */
#navbar {
  top: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 900;
  transition: background var(--transition-time) ease;
}

.nav-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbarlogo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-title {
  margin: 15px 0px;
  margin-left: 15px;
  font-size: 30px;
  font-weight: 450;
  font-style: oblique;
}

#themeToggle {
  width: 35px;
  height: 35px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#themeToggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15),
    0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* =====================================================
   Main Container
===================================================== */
main {
  justify-content: center;
  padding: 20px;
  max-width: 80%;
  margin: 20px auto 0 auto;
  /* leave space for navbar */
}

/* =====================================================
   Folder and File List Styling
===================================================== */

/* Top-Level Folder Container as Flex */
#folderContainer {
  margin-bottom: 30px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
  transition: all 0.15s ease !important;
}

.folder-section {
  margin: 15px 0px;
  background: var(--folder-bg);
  color: var(--folder-text);
  padding: 15px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: folderFadeIn 0.5s ease forwards;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important,
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
  box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.08),
    0px 1px 4px rgba(0, 0, 0, 0.03),
    inset 0px 0px 8px hsla(210, 100%, 95%, 0.15),
    inset 0px 0px 8px hsla(0, 0%, 50%, 0.03);
}

/* Hover Effects for Top-Level Folder */
.folder-section:hover {
  transform: translateY(-3px);
  box-shadow:
    0px 8px 25px rgba(0, 0, 0, 0.12),
    0px 2px 6px rgba(0, 0, 0, 0.05),
    inset 0px 0px 10px hsla(210, 100%, 95%, 0.15),
    inset 0px 0px 10px hsla(0, 0%, 50%, 0.15);
}

/* Folder Heading */
.folder-section h3 {
  font-size: 20px;
  font-style: italic;
  transition: color 0.3s ease;
  color: var(--text-color);
}

.folderName {
  align-items: center;
  margin-bottom: 10px;
}

.nested-folders {
  column-count: 2;
  column-gap: 20px;
  margin-top: 15px;
  margin-left: 7.5%;
  margin-right: 7.5%;
}

.nested-folder {

  min-width: fit-content;
  break-inside: avoid;
  background: var(--folder-bg);
  color: var(--folder-text);
  padding: 10px;
  border: none;
  border-radius: 8px;
  margin-bottom: 20px;
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
  animation: folderFadeIn 0.5s ease forwards;
  width: 100%;
  box-sizing: border-box;

  /* Modern sleek look */
  border-radius: 10px;
  /* Slightly more rounded than 8px for softness */
  box-shadow:
    0px 3px 10px rgba(0, 0, 0, 0.08),
    0px 1px 3px rgba(0, 0, 0, 0.03),
    inset 0px 0px 5px hsla(210, 100%, 95%, 0.1),
    inset 0px 0px 5px hsla(0, 0%, 50%, 0.02);
}

.nested-folder:hover {
  transform: translateY(-2px);
  box-shadow:
    0px 5px 15px rgba(0, 0, 0, 0.12),
    0px 2px 5px rgba(0, 0, 0, 0.05),
    inset 0px 0px 7px hsla(210, 100%, 95%, 0.2),
    inset 0px 0px 7px hsla(0, 0%, 50%, 0.04);
}

/* Your original flex property is no longer needed: */
/* flex: 1 1 400px; --- This is removed as it only applies to flexbox layouts. */
@media (max-width: 1040px) {

  /* Nested Folders Container as Flex */
  .nested-folders {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    margin-left: 7.5%;
    margin-right: 7.5%;
  }

  /* Nested Folder Box Styling */
  .nested-folder {
    flex: 1 1 400px;
    background: var(--folder-bg);
    color: var(--folder-text);
    padding: 10px;
  }
}

.nested-folder h4 {
  margin: 0 0 10px 0;
  text-align: center;
  font-size: 20px;
  transition: color 0.3s ease;
  padding-right: 30px;
  /* space for pin icon */
  color: var(--text-color);
}

/* Folder animations */
.folder-node .folder-content {
  overflow: hidden;
  transform-origin: top;
  transition:
    max-height 0.3s ease-out,
    transform 0.3s ease-out,
    opacity 0.2s ease-out;
  max-height: 0;
  opacity: 0;
  transform: scaleY(0);
}

.folder-node.active .folder-content {
  max-height: 100000px;
  opacity: 1;
  transform: scaleY(1);
}

/* Sibling movement */
.folder-section {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.folder-node.active+.folder-node:not(.active) {
  transform: translateY(10px);
  opacity: 0.9;
}

.folder-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.folder-node.open .folder-content {
  opacity: 1;
}

/* File list visibility */
.file-list {
  display: block !important;
  opacity: 1 !important;
}

/* Image thumbnails */
.thumbnail {
  max-height: 50px;
  margin-right: 10px;
  border-radius: 5px;
  transition: transform 0.2s ease;
  filter: none !important;
}

/* Pin Button Transition */
.pin-button {
  transition: opacity 0.2s ease !important;
}

/* First-level folders inside repository - clickable styling */
.folder-content > .folder-section {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.folder-content > .folder-section:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Ensure first-level folders start closed */
.folder-content > .folder-section:not(.active) .folder-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

/* Folder Reordering */
.folder-section {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* File List Styles */
ul.file-list {
  list-style: none;
  padding: 0;
}

li.file-item {
  max-width: 100%;
  margin: 10px 0;
  padding: 10px;
  background: var(--folder-bg);
  color: var(--text-color);
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;

  box-shadow:
    0px 3px 10px rgba(0, 0, 0, 0.08),
    0px 1px 3px rgba(0, 0, 0, 0.03),
    inset 0px 0px 5px hsla(210, 100%, 95%, 0.1),
    inset 0px 0px 5px hsla(0, 0%, 50%, 0.02);
}

li.file-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0px 5px 15px rgba(0, 0, 0, 0.12),
    0px 2px 5px rgba(0, 0, 0, 0.05),
    inset 0px 0px 7px hsla(210, 100%, 95%, 0.2),
    inset 0px 0px 7px hsla(0, 0%, 50%, 0.04);
}

li.file-item .file-title {
  font-weight: bold;
  font-style: italic;
  flex: 1;
  margin-right: 10px;
  margin-left: 5px;
}

li.file-item button {
  margin: 2.55px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;

  transition: background var(--transition-time) ease;
}

/* Updated Button Styles Using Theme Variables */
button.view-button {
  font-family: 'Noto Serif', 'Times New Roman', Times, serif;
  background-color: var(--button-view-bg);
  color: var(--text-color);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  transition: all 0.2s ease;

  box-shadow:
    0px 4px 12px rgba(0, 0, 0, 0.15),
    0px 1px 2px rgba(0, 0, 0, 0.05),
    inset 0px 0px 3px rgba(255, 255, 255, 0.2);
}

button.view-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0px 6px 16px rgba(0, 0, 0, 0.2),
    0px 2px 4px rgba(0, 0, 0, 0.1),
    inset 0px 0px 5px rgba(255, 255, 255, 0.3);
}

button.download-button {
  font-family: 'Noto Serif', 'Times New Roman', Times, serif;
  background-color: var(--button-download-bg);
  color: var(--text-color);
  padding: 10px 20px;
  border: 1.5px solid var(--button-download-border);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  transition: all 0.2s ease;

  box-shadow:
    0px 2px 6px rgba(0, 0, 0, 0.08);
}

button.download-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0px 3px 8px rgba(0, 0, 0, 0.12);
}

.share-notification {
  will-change: transform, opacity;
  transform-origin: center;
}

/* Thumbnail for Image Files */
.thumbnail {
  max-height: 50px;
  margin-right: 10px;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.thumbnail:hover {
  transform: scale(1.05);
}

/* =====================================================
   Animations
===================================================== */
@keyframes folderFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   Modal Styles
===================================================== */
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  backdrop-filter: blur(5px);
  background: rgba(0, 0, 0, 0.5);
}

/* Modal Content Container */
.modal-content {
  position: relative;
  margin: 5% auto;
  max-width: 500px;
  width: 90%;
  background: var(--bg-color);
  border-radius: 16px;
  padding: 20px;
  animation: fadeInUp 0.2s ease forwards;
  border: none;

  box-shadow:
    0px 10px 40px rgba(0, 0, 0, 0.2),
    0px 5px 15px rgba(0, 0, 0, 0.1),
    inset 0px 0px 10px hsla(210, 100%, 95%, 0.1);
}

/* Modal Header for title and close button */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0;
  background: var(--primary-color);
  /* Use primary color for header */
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--folder-text);
  /* Using folder text color */
}

/* Close Button as an Icon */
.close-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  /* Remove border/background so only image shows */
  border: none;
  background: transparent;
}

/* Modal Body (optional, if you want a border between header and body) */
.modal-body {
  padding: 20px;
}

/* Modal fade in/up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal fade out/down animation */
@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}


.modal-content.closing {
  animation: fadeOutDown 0.2s ease forwards;
}


.close-button {
  position: absolute;
  top: 20px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 30px;
  z-index: 1010;
  filter: invert(var(--reverse));
  background-image: url('https://img.icons8.com/?size=100&id=vu5kHwGC4PNb&format=png&color=000000');
  /* Use your logo URL */
  background-size: contain;
  /* Or cover, adjust as needed */
  background-repeat: no-repeat;
  background-position: center;
  width: 20px;
  height: 20px;
}

.pdf-container {
  position: relative;
  width: 100%;
  padding-bottom: calc(100% * (297 / 210));
  overflow: hidden;
  border-radius: 12px;
  margin-top: 20px;


  box-shadow:
    2px 2px 4px #b8b8b8,
    /* Top-left highlight */
    -2px -2px 4px #b8b8b8,
    /* Bottom-right highlight */
    2px -2px 4px #2c2c2c,
    /* Top-right shadow */
    -2px 2px 4px #2c2c2c;
  /* Bottom-left shadow */
}

.pdf-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.image-modal-content {
  max-width: 800px;
  padding: 20px;
  position: relative;
}

.image-modal-content img {
  border: solid 1px var(--border-color);
  width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: opacity 0.3s ease;
}

.code-modal-content {
  max-width: 800px;
  padding: 20px;
  position: relative;
}

#codeViewer {
  background: #f4f4f4;
  color: #333;
  padding: 15px;
  border-radius: 4px;
  max-height: 70vh;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
}

/* Navigation Buttons for Image Modal */
.nav-button {
  position: absolute;
  z-index: 1500;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  font-size: 24px;
  padding: 10px;
  border-radius: 30%;
  transition: all 0.2s;
  filter: grayscale(100);
}

.prev-button {
  left: 10px;
  background-color: transparent;
  background-image: url("https://img.icons8.com/?size=40&id=19037&format=png&color=000000");
  width: 40px;
  height: 40px;
}

.next-button {
  right: 10px;
  background-color: transparent;
  background-image: url("https://img.icons8.com/?size=40&id=19034&format=png&color=000000");
  width: 40px;
  height: 40px;
}

/* Footer Styles */
#main-footer {
  background: var(--nav-bg);
  border-top: var(--border-color) 1px solid;
  color: var(--folder-text);
  padding: 40px 20px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transition: background var(--transition-time) ease, color var(--transition-time) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 50px;
  max-width: 1200px;
  width: 100%;
  padding: 0 40px;
  margin-bottom: 30px;
  text-align: justify;
}

.footer-section {
  flex: 1;
  min-width: 300px;
}

.footer-section h3 {
  font-size: 1.2em;
  margin-bottom: 15px;
  color: var(--text-color);
  padding-bottom: 7.5px;
}

.footer-section p {
  font-size: 1.0em;
  line-height: 1.6;
  color: var(--folder-text-light);
  margin-bottom: 10px;
}

.footer-section p.break {
  margin-bottom: 5px;
}

.footer-section p a {
  color: var(--folder-text-light);
  /* This should now correctly apply the color */
  text-decoration: none;
  transition: color 0.3s ease;
  /* IMPORTANT FIXES BELOW */
  background: none;
  /* Ensure no background gradient covers the text */
  -webkit-background-clip: unset;
  /* Remove text clipping */
  -webkit-text-fill-color: unset;
  /* Ensure text color is not overridden by fill color */
}

/* Colorless hover for text links */
:root .footer-section p a:hover {
  color: #000000;
  text-decoration: underline;
}

[data-theme="dark"] .footer-section p a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.social-links {
  margin-top: 20px;
  display: flex;
  gap: 20px;
}

.social-links .social-icon {
  color: var(--folder-text-light);
  transition: color 0.3s ease;
  display: flex;
  /* Ensure no gradient interference for SVG icons either */
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

/* Darker/Lighter hover for social icons/logos */
:root .social-links .social-icon:hover {
  color: #333333;
}

[data-theme="dark"] .social-links .social-icon:hover {
  color: #E0E0E0;
}

.social-links svg {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.footer-bottom {
  border-top: solid 1px var(--border-color);
  width: 100%;
  max-width: 1200px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85em;
  color: var(--folder-text-light);
}

.footer-bottom p {
  font-size: 1.25em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 0 20px;
  }

  .footer-section {
    min-width: unset;
    width: 100%;
  }

  .footer-about {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .footer-section h3 {
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

h5 {
  font-weight: 400;
  font-style: italic;
}

img {
  filter: invert(var(--reverse));
  transition: transform 0.2s ease-in-out;
}

img:active {
  transform: scale(0.80);
}

/* Enhanced Mobile Responsiveness */
@media screen and (max-width: 768px) {
  main {
    max-width: 95%;
    padding: 15px;
    margin: 15px auto 0 auto;
  }

  .nav-title {
    font-size: 1.2rem;
    margin-left: 10px;
  }

  .nav-controls {
    gap: 10px;
  }

  #themeToggle,
  #searchButton,
  .pin-toggle-button {
    width: 32px;
    height: 32px;
  }

  .folder-section {
    padding: 12px;
  }

  .nested-folders {
    column-count: 1;
    margin-left: 2%;
    margin-right: 2%;
  }

  .nested-folder {
    margin-bottom: 15px;
    padding: 8px;
  }

  li.file-item {

    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .file-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }

  button.view-button,
  button.download-button {
    padding: 8px 16px;
    font-size: 0.9em;
  }
}

@media screen and (max-width: 600px) {
  .nav-title {
    font-size: 1rem;
  }

  h4 {
    font-size: 0.85rem;
  }

  h5 {
    font-size: 0.75rem !important;
  }

  li.file-item {
    font-size: 0.85rem;
  }

  .modal-content {
    width: 90%;
    margin: 10% auto;
    padding: 15px;
  }

  .share-notification {
    font-size: 14px !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
  }

  .folder-size-info {
    font-size: 0.65em !important;
    padding: 2px 6px !important;
    margin-left: 5px !important;
  }
}

@media screen and (max-width: 480px) {
  .nav-content {
    padding: 0 5px;
  }

  .navbarlogo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .nav-title {
    display: none;
  }

  #usageDashboardBtn {
    font-size: 18px;
  }

  main {
    max-width: 98%;
    padding: 10px;
  }


  .folder-section h3 {
    font-size: 1.1rem;
  }

  .nested-folder h4 {
    text-align: center;
    font-size: 1rem;
  }

  li.file-item {
    padding: 10px;
    font-size: 0.8rem;
  }

  button.view-button,
  button.download-button {
    padding: 6px 12px;
    font-size: 0.8em;
  }
}

/* =====================================================
   Search Component Enhancements
===================================================== */
#searchButton {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 50%;
  transition: all var(--transition-time) ease;
  position: absolute;
  right: 0;
  z-index: 2;
  margin-right: 0px;
}

.search-icon {
  width: 20px;
  height: 20px;
  filter: invert(var(--reverse));
  transition: transform 0.2s ease;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

#searchInput {
  width: 0;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-time) ease;
  border: 2px solid var(--text-color);
  background: var(--nav-bg);
  color: var(--text-color);
  height: 35px;
  border-radius: 7.5px;
  padding: 0;
  position: absolute;
  right: 40px;
}

#searchInput.active {
  width: 200px;
  opacity: 1;
  visibility: visible;
  padding: 0 15px;
  position: relative;
  margin: 12.5px;
}

#searchButton {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-right: -5px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#searchButton:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15),
    0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

#searchButton:hover .search-icon {
  transform: scale(1.1);
}

/* Search Results */
#searchResults {
  display: grid;
  gap: 10px;
  padding: 0px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  animation: fadeIn 0.3s ease;
}

.search-result-item {
  padding: 15px;
  background: var(--item-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  background: var(--folder-bg);
}

.search-result-item img {
  width: 24px;
  height: 24px;
  filter: invert(var(--reverse));
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;

  }
}

/* Mobile Optimization */
@media screen and (max-width: 600px) {
  .search-container {
    max-width: 200px;
    gap: 5px;
  }

  .nav-title {
    display: none;
  }

  #searchInput {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  #searchButton {
    padding: 6px;
    margin-right: -5px;
  }

  .search-icon {
    width: 18px;
    height: 18px;
  }

  #searchResults {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .search-result-item {
    padding: 12px;
    gap: 10px;
  }

  #searchInput.active {
    width: 150px;
  }

  .nav-controls {
    gap: 8px;
  }

  .search-icon {
    width: 20px;
    height: 20px;
  }

  #searchInput.active {
    width: 130px;
    opacity: 1;
    visibility: visible;
    padding: 0 15px;
    position: relative;
    margin: 12.5px;
  }
}

/* AI button style */
.ai-button {
  position: fixed;
  bottom: 75px;
  right: 10px;
  border: none;
  background: transparent;
  z-index: 1000;
  background-color: var(--folder-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  padding: 10px;
  filter: invert(var(--invert));
}

.ai-button img {
  width: 30px;
  height: 30px;
}

/* Chat modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content.ai-chat-box {
  background-color: var(--folder-bg);
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 75vh;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  min-height: 50vh;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--nav-bg);
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}

.chat-input {
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 8px;
  background-color: var(--nav-bg);
  border-radius: 7.5px;
  padding: 10px 12px;
}

.chat-input input[type="text"] {
  color: var(--text-color);
  /* sets the placeholder text color to a lighter grey */
}

.chat-input button {
  padding: 8px 10px;
  background-color: var(--nav-bg);
  border-radius: 5px;
  color: var(--text-color);
}

.chat-message {
  margin: 5px 0;
  padding: 8px 12px;
  border-radius: 5px;
  max-width: 80%;
  word-wrap: normal;
  display: flex;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-user,
.chat-bot {
  background-color: var(--toggle-bg);
  color: var(--text-color);
  text-align: justify;
  word-wrap: break-word;
  white-space: pre-wrap;
  align-self: flex-start;
  display: inline-block;
  max-width: 80%;
  padding: 10px;
  border-radius: 8px;
  margin: 5px 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
  border: 1.5px solid var(--folder-bg);
}

.chat-bot {
  background-color: var(--textbox-user);
  align-self: flex-end;
}


.chat-user {
  background-color: var(--textbox-bot);
  color: var(--text-color);
  text-align: justify;
  word-wrap: normal;
  align-self: flex-start;
  display: inline;
}

.chat-bot {
  background-color: var(--bg-color);
  align-self: flex-end;
  text-align: justify;
  display: inline;
}

.modal-content .close {
  position: absolute;
  top: 0px;
  right: 20px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-color);
  user-select: none;
}

.invisible {
  display: none;
}

.pin-toggle-button {
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  margin-left: 0px;
  margin-right: 10px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pin-toggle-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15),
    0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pin-toggle-button img {
  width: 80%;
  /* Make the image fill the button's width */
  height: 100%;
  /* Make the image fill the button's height */
  object-fit: contain;
  /* Ensures the image scales down to fit without cropping */
  filter: invert(var(--reverse));
  /* Apply your color filter */
  transition: opacity 0.2s ease;
  /* Smooth transition for opacity changes */
}

/* Style for when the button is active/toggled to show only pinned */
.pin-toggle-button.active img {
  opacity: 1;
  /* Fully visible when active */
}

/* Style for when the button is inactive/showing all */
.pin-toggle-button:not(.active) img {
  opacity: 0.3;
  /* Less visible when inactive */
}

.togglebtn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.icons {
  background-color: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 75px;
  right: 10px;
  padding: 7.5px;
  border: var(--text-color) 2.5px solid;
  border-radius: 7.5px;
  z-index: 10000;
}

/* Style for the logo button (remains unchanged) */
.app-logo-button {
  background: none;
  border: none;
  padding: 0;
  width: 70px;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-logo-button img {
  width: 80px;
  height: auto;
}

/* General styles for content sections */
.main-content-section {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  /* Prevents interaction when transparent/hidden */
  min-height: 100px;
  box-sizing: border-box;
  padding: 20px;
  color: var(--text-color);
  overflow-y: auto;
  /* Enable scrolling for content if needed */
}

.about {
  display: none;
  /* Initially hidden. JavaScript will change this. */
}

/* State for the active (visible) content section */
.main-content-section.active {
  opacity: 1;
  pointer-events: auto;
  align-items: center;
  /* display property is managed by JavaScript in toggleAppContent() */
}

.main-content-section h2 {
  color: var(--text-color);
  text-align: center;
  font-size: 28px;
  margin-bottom: 25px;
  /* Adds space below the main heading */
}

.main-content-section h3 {
  color: var(--text-color);
  font-size: 22px;
  /* Slightly smaller than h2, but still prominent */
  margin-top: 30px;
  /* Adds space above sub-headings */
  margin-bottom: 15px;
  /* Adds space below sub-headings */
}

.main-content-section p {
  color: var(--text-color);
  font-size: 16px;
  text-align: justify;
  line-height: 1.6;
  /* Improves readability by increasing line spacing */
  margin-bottom: 20px;
  /* Adds space between paragraphs */
}

.main-content-section ul {
  color: var(--text-color);
  list-style-type: disc;
  /* Ensures bullet points are visible */
  padding-left: 25px;
  /* Adds indentation for list items */
  margin-bottom: 20px;
  /* Adds space below the entire list */
}

.main-content-section li {
  color: var(--text-color);
  font-size: 16px;
  /* Matches the font size of paragraphs */
  line-height: 1.6;
  /* Matches line height for consistency */
  margin-bottom: 10px;
  /* Adds space between list items */
}

.text {
  background: var(--bg-color);
  color: var(--folder-text);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  animation: folderFadeIn 0.5s ease forwards;
  transition: transform 0.5s ease, order 0.5s ease, box-shadow 0.3s ease;
}

.break {
  width: 90%;
  height: 2.5px;
  /* You can increase this height if you want the "ray" to be visually thicker overall */
  margin: 5px auto;
  /* Keeps it centered horizontally */

  /* Ray-like appearance: thicker in center, thinner at sides */
  background: var(--gradient);
  border: 0px solid !important;
  border-radius: 2px;
  animation: lineReveal 0.8s ease-out forwards;
}

.cardBox {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.card {
  background-color: var(--folder-bg);
  border: none;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  max-width: 300px;
  width: 100%;
  box-sizing: border-box;
  margin: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  box-shadow:
    0px 5px 18px rgba(0, 0, 0, 0.08),
    0px 1px 4px rgba(0, 0, 0, 0.03),
    inset 0px 0px 8px hsla(210, 100%, 95%, 0.15),
    inset 0px 0px 8px hsla(0, 0%, 50%, 0.03);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0px 8px 25px rgba(0, 0, 0, 0.12),
    0px 2px 6px rgba(0, 0, 0, 0.05),
    inset 0px 0px 10px hsla(210, 100%, 95%, 0.25),
    inset 0px 0px 10px hsla(0, 0%, 50%, 0.05);
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: none;
  margin-bottom: 10px;
  background-color: var(--folder-bg);
  filter: none !important;
}

.card-heading {
  font-family: 'Noto Serif', 'Times New Roman', Times, serif;
  font-size: 1rem;
  font-style: normal;
  color: var(--folder-text);
  margin-top: 0px;
  margin-bottom: 8px;
}

.card-title {
  font-family: 'Noto Serif', 'Times New Roman', Times, serif;
  text-align: justify;
  font-size: 0.75rem;
  color: var(--folder-text-light);
  line-height: 1.5;
}

.loader {
  width: 20vh;
  --b: 20px;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 1px;
  background: conic-gradient(#0000 10%, var(--text-color)) content-box;
  mask: inherit;
  -webkit-mask:
    repeating-conic-gradient(#0000 0deg, #000 1deg 20deg, #0000 21deg 36deg),
    radial-gradient(farthest-side, #0000 calc(100% - var(--b) - 1px), #000 calc(100% - var(--b)));
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
  animation: l4 1s infinite steps(10);
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px;
  margin-bottom: 20px;
}

@keyframes l4 {
  to {
    transform: rotate(1turn)
  }
}

#recentFilesContainer {
  margin-bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#recentFilesContainer2 {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.recentFiles {
  width: 90%;
  margin: 20px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.396);
  color: var(--text-color);
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recentFilesTitle {
  display: flex;
  justify-content: space-between;
  margin-left: 10vw;
  margin-right: 10vw;
  align-items: center;
}

.recentFilesTitle .titles {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: flex-start;
}

.recentFilesTitle img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}

.recentFiles {
  transition: opacity 0.3s ease-out, transform 1s ease-out !important;
  /* Only animate opacity and transform now */

}

/* Styles for when a recent file item is being removed */
.recentFiles.removing-file {
  opacity: 0;
  /* Fade out */
  transform: translateX(100%);
  /* Slide out to the right */
  /* Removed height, margin, and padding transitions to keep the item's space until fully gone */
}

#clearRecent {
  background-color: transparent;
  border: none;
  color: transparent;
  border-radius: 5px;
}

#clearRecent img {
  width: 25px;
  height: 25px;
}

#pdfModal {
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#recentModal {
  position: relative;
  margin: 5% auto;
  max-width: 600px;
  min-width: 600px;
  width: 90%;
  background: rgba(0, 0, 0, 0) !important;
  border-radius: 16px;
  animation: fadeInUp 0.2s ease forwards;
  border: none;
  box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.2), 0px 5px 15px rgba(0, 0, 0, 0.1), inset 0px 0px 10px hsla(210, 100%, 95%, 0.1);
}

.recentTitle {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

@media screen and (max-width: 1300px) {
  #pdfModal {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 20px;
    min-width: 0;
    overflow-y: auto;
  }

  #recentModal {
    min-width: 0;
    flex: 1;
  }

}

body.modal-open {
  overflow: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background-color: var(--bg-color);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb {
  border-radius: 2px;
  border: 0.5px solid var(--border-color);
  cursor: var(--cursor);
}

:root {
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        /* Top to bottom */
        hsla(0, 0%, 100%, 0.8),
        /* White, matching light theme's base */
        hsla(0, 0%, 50%, 0.6)
        /* Mid-grey, darker but still subtle for light mode */
      );
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        hsla(0, 0%, 95%, 0.9),
        hsla(0, 0%, 40%, 0.7));
  }

  ::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg,
        hsla(0, 0%, 90%, 1),
        hsla(0, 0%, 30%, 0.8));
  }
}

[data-theme="dark"] {
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        /* Top to bottom */
        hsla(0, 0%, 10%, 0.8),
        /* Dark grey/near black, matching dark theme's base */
        hsla(0, 0%, 70%, 0.6)
        /* Lighter grey, subtle for dark mode */
      );
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.08);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        hsla(0, 0%, 15%, 0.9),
        hsla(0, 0%, 80%, 0.7));
  }

  ::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg,
        hsla(0, 0%, 20%, 1),
        hsla(0, 0%, 90%, 0.8));
  }
}

::-webkit-scrollbar-corner {
  background-color: var(--bg-color);
}

::-webkit-resizer {
  background-color: var(--folder-bg);
}

/* ====
=================================================
   Enhanced Feature Styles
===================================================== */

/* Smooth Transitions for All Interactive Elements */
* {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced Folder Animations */
.folder-node {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  transform-origin: top center;
}

.folder-node.expanding {
  animation: expandFolder 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.folder-node.collapsing {
  animation: collapseFolder 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes expandFolder {
  0% {
    transform: scaleY(0.8) translateY(-10px);
    opacity: 0.7;
  }

  50% {
    transform: scaleY(1.02) translateY(-5px);
    opacity: 0.9;
  }

  100% {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
}

@keyframes collapseFolder {
  0% {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }

  50% {
    transform: scaleY(0.95) translateY(-2px);
    opacity: 0.8;
  }

  100% {
    transform: scaleY(0.8) translateY(-10px);
    opacity: 0.6;
  }
}

/* Enhanced Modal Transitions */
.modal {
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.modal.show {
  animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.modal.hide {
  animation: modalFadeOut 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes modalFadeIn {
  0% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }

  100% {
    opacity: 1;
    backdrop-filter: blur(5px);
  }
}

@keyframes modalFadeOut {
  0% {
    opacity: 1;
    backdrop-filter: blur(5px);
  }

  100% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

.modal-content {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.3s ease,
    scale 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content.show {
  animation: modalContentShow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.modal-content.hide {
  animation: modalContentHide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes modalContentShow {
  0% {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }

  50% {
    transform: translateY(-5px) scale(1.02);
    opacity: 0.8;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes modalContentHide {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
}

/* Enhanced Button Interactions */
button {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
}


button:active {
  transform: scale(0.98);
  transition: all 0.1s ease;
}


/* Glowing effect for interactive elements */
.view-button:hover,
.download-button:hover {
  box-shadow: 0 0 20px rgba(129, 129, 129, 0.4),
    0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Enhanced File Item Animations */
.file-item {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: left center;
}

.file-item:hover {
  transform: translateX(5px) translateY(-2px) scale(1.01);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Thumbnail Enhancements */
.thumbnail {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
}

.thumbnail:hover {
  transform: scale(1.15) rotate(3deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* Search Input Animation */
#searchInput {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#searchInput.active {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Pin Button Glow Effect */
.pin-button {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pin-button:hover {
  transform: scale(1.1) rotate(15deg);
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Folder Size Info Animation */
.folder-size-info {
  margin-top: 10px;
  transition: all 0.3s ease;
  transform: translateX(10px);
  opacity: 0.6;
}

.folder-node:hover .folder-size-info {
  transform: translateX(0);
  opacity: 1;
}

/* Usage Dashboard Styles */
#usageDashboard {
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.dashboard-header {
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.dashboard-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.5em;
}

.stat-item {
  transition: all 0.2s ease;
  border: 1px solid transparent;
}


/* Rate Limit Display */
.rate-limit-info {
  background: var(--nav-bg);
  padding: 10px;
  border-radius: 5px;
  border-left: 4px solid var(--text-color);
}

.rate-limit-info span {
  display: block;
  margin: 2px 0;
}

/* Floating Action Buttons */
button[style*="position: fixed"] {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

button[style*="position: fixed"]:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Recent Files Enhanced Layout */
.recentFiles .file-info {
  display: flex;
  flex-direction: column;
  gap: 7.5px;
}

.file-timestamp {
  font-size: 0.75em;
  color: var(--folder-text-light);
  font-style: italic;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.recentFiles:hover .file-timestamp {
  opacity: 1;
}

/* Responsive Enhancements */
@media screen and (max-width: 768px) {
  .modal-content {
    margin: 10% auto;
    max-width: 85vw;
    padding: 15px;
  }

  #usageDashboard {
    width: 95%;
    padding: 20px;
  }

  .dashboard-content {
    gap: 10px;
  }

  .stat-item {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }


}

/* Loading Animation for Rate Limit */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.rate-limit-loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Success/Error States */
.rate-limit-success {
  border-left-color: #85ef88;
}

.rate-limit-warning {
  border-left-color: #ffae34;
}

.rate-limit-error {
  border-left-color: #ff4032;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Focus Indicators */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(129, 129, 129, 0.2);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .folder-bg {
    border: 2px solid var(--text-color);
  }

  .modal-content {
    border: 3px solid var(--text-color);
  }

  button {
    border: 2px solid var(--text-color);
  }
}

/* Recent
 Files Controls */
.recent-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.ratedisplay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rate-limit-display {
  display: block;
  margin: 30px;
  width: fit-content;
  font-size: 1.2em;
  color: var(--folder-text-light);
  background: var(--nav-bg);
  border-radius: 5px;
  border: 1px solid var(--border-color);
  min-width: 200px;
}

.rate-limit-info {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rate-limit-info span {
  white-space: nowrap;
}

@media screen and (max-width: 768px) {
  .recent-controls {
    gap: 0px;
    align-items: flex-end;
  }

  .rate-limit-display {
    text-align: center;
    min-width: auto;
    font-size: 1em;
  }

  .rate-limit-info {
    gap: 2px;
  }
}

/* ======
===============================================
   Usage Dashboard Navbar Button
===================================================== */
.usage-dashboard-nav-btn {
  background-color: transparent;
  border: none;
  color: transparent;
  border-radius: 5px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.usage-dashboard-nav-btn img {
  width: 25px;
  height: 25px;
}

.usage-dashboard-nav-btn:hover {
  transform: scale(1.05);
}

.usage-dashboard-nav-btn:active {
  transform: translateY(0) scale(0.98);
}

/* =====================================================
   Enhanced Glassy Design Elements
===================================================== */

/* Remove black borders from close buttons */


/* Enhanced glassy design for all elements */
.folder-section,
.nested-folder {

  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.file-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-content {

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 16px 64px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .modal-content {
  background: rgba(40, 40, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}


/* Enhanced navbar with glassy effect */
#navbar {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced search input */
#searchInput {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#searchInput:focus {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}



/* Enhanced folder size info */
.folder-size-info {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.folder-node:hover .folder-size-info {
  background: rgba(255, 255, 255, 0.083) !important;
  transform: translateX(0) scale(1.02) !important;
}

/* Enhanced recent files styling */
.file-info {
  display: flex;
  flex-direction: column;

  gap: 4px;
}

.file-timestamp {
  font-size: 0.7em;
  color: var(--folder-text-light);
  font-style: italic;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: fit-content;
  transition: all 0.3s ease;
}

.recentFiles:hover .file-timestamp {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

.file-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Enhanced dashboard styling */
#usageDashboard {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] #usageDashboard {
  background: rgba(40, 40, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-header {
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.stat-item {
  background: var(--nav-bg);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);

  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced theme toggle */
#themeToggle {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#themeToggle:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced pin toggle button */
.pin-toggle-button {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pin-toggle-button:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced footer */
#main-footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dark theme adjustments for glassy effect */
[data-theme="dark"] .folder-section,
[data-theme="dark"] .nested-folder {
  background: rgba(40, 40, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .file-item {
  background: rgba(50, 50, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}


[data-theme="dark"] #navbar {
  background: rgba(30, 30, 30, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}


[data-theme="dark"] .folder-size-info {
  background: rgba(60, 60, 60, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .file-timestamp {
  background: rgba(60, 60, 60, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .usage-dashboard-nav-btn {
    font-size: 14px;
  }

  .navbarlogo {
    flex-wrap: wrap;
    gap: 5px;
  }

  .nav-title {
    font-size: 1.2em;
  }

  .file-timestamp {
    font-size: 0.65em;
    padding: 1px 4px;
  }

  .folder-size-info {
    font-weight: 300 !important;
    padding: 1px 6px !important;
    margin-left: 8px !important;
  }
}

@media screen and (max-width: 480px) {
  .usage-dashboard-nav-btn {
    font-size: 12px;
  }

  .nav-title {
    font-size: 1em;
  }
}

#imageViewer {
  filter: none !important;
  border-radius: 10px;
}