body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f1f3f4;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 240px;
  right: 0;
  height: 64px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1000;
  animation: colorChange 10s infinite alternate;
}

@keyframes colorChange {
  0% { background-color: #ffffff; }
  100% { background-color: #e3f2fd; }
}

.top-bar .logo {
  display: flex;
  align-items: center;
  margin-right: 24px;
}

.top-bar .logo svg {
  margin-right: 8px;
  width: 32px;
  height: 32px;
}

.top-bar h1 {
  font-size: 20px;
  margin: 0;
  color: #202124;
}

.top-bar .search-container {
  flex: 1;
  position: relative;
}

.top-bar input[type="text"] {
  width: 100%;
  padding: 8px 40px 8px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  background-color: #f1f3f4;
  transition: background-color 0.3s ease;
}

.top-bar input[type="text"]:focus {
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 1px #4285f4;
  border-color: #4285f4;
}

.top-bar .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  fill: #80868b;
}

.top-bar .user-profile {
  margin-left: 24px;
  cursor: pointer;
}

.top-bar .user-profile svg {
  width: 32px;
  height: 32px;
  fill: #555555;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: 1px 0 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  padding-top: 64px; /* To align with top bar */
  overflow-y: auto;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: #5f6368;
  text-decoration: none;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.sidebar a:hover {
  background-color: #f1f3f4;
}

.sidebar a img {
  margin-right: 16px;
  width: 24px;
  height: 24px;
}

.sidebar a.active {
  background-color: #e3f2fd;
  color: #4285f4;
}

/* Reduced size for My Drive icon */
.sidebar a svg {
  margin-right: 8px;
  width: 20px; /* Reduced from original size */
  height: 20px; /* Reduced from original size */
}

/* Main Content */
.main-content {
  margin-left: 240px;
  margin-top: 64px;
  padding: 24px;
  width: calc(100% - 240px);
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.upload-container {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

.upload-button {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background-color: #4285f4;
  color: #ffffff;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  position: relative;
}

.upload-button:hover {
  background-color: #3367d6;
}

.upload-button svg {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.upload-button:hover svg {
  transform: scale(1.1);
}

input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
  height: 100%;
  width: 100%;
}

.upload-button:active {
  transform: scale(0.98);
}

/* Uploaded Files */
#uploaded-files, #trashed-files {
  background: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}

#uploaded-files h2, #trashed-files h2 {
  margin-top: 0;
  font-size: 20px;
  color: #202124;
  margin-bottom: 16px;
}

#file-list, #trashed-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#file-list li, #trashed-file-list li {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

#file-list li:last-child, #trashed-file-list li:last-child {
  border-bottom: none;
}

.file-name {
  color: #202124;
  flex: 1;
  min-width: 150px;
  font-size: 16px;
}

.file-name input {
  font-size: 16px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

.button-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.remove-button, .download-button, .save-button, .cancel-button, .restore-button, .permanent-delete-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.3s ease, background-color 0.3s ease;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 4px;
}

.remove-button {
  color: #d93025;
}

.remove-button:hover {
  color: #ffffff;
  background: #d93025;
}

.download-button {
  color: #1a73e8;
  display: flex;
  align-items: center;
}

.download-button:hover {
  color: #ffffff;
  background: #1a73e8;
}

.download-button svg {
  margin-right: 4px;
}

.save-button {
  color: #0f9d58;
}

.save-button:hover {
  color: #ffffff;
  background: #0f9d58;
}

.cancel-button {
  color: #f4b400;
}

.cancel-button:hover {
  color: #ffffff;
  background: #f4b400;
}

.restore-button {
  color: #1a73e8;
}

.restore-button:hover {
  color: #ffffff;
  background: #1a73e8;
}

.permanent-delete-button {
  color: #d93025;
}

.permanent-delete-button:hover {
  color: #ffffff;
  background: #d93025;
}

.download-count {
  margin-left: 6px;
  color: #555555;
  font-size: 12px;
}

.file-info {
  display: flex;
  flex-direction: column;
}

.upload-date {
  color: #757575;
  font-size: 12px;
  margin-top: 4px;
}

/* Scrolling Stats */
.scrolling-stats {
  width: 100%;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.scrolling-text {
  display: inline-block;
  animation: scroll-left 20s linear infinite;
  color: #5f6368;
  font-size: 14px;
}

@keyframes scroll-left {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Settings Content */
#settings-content {
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-container h2 {
  margin-top: 0;
  font-size: 24px;
  color: #202124;
  margin-bottom: 32px;
}

.settings-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 18px;
  color: #202124;
  margin-bottom: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 0;
}

.setting-item label {
  font-size: 14px;
  color: #5f6368;
  min-width: 150px;
}

.setting-item select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #ffffff;
  color: #202124;
  font-size: 14px;
  min-width: 120px;
}

.setting-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.storage-bar {
  width: 200px;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 12px;
}

.storage-used {
  height: 100%;
  background-color: #4285f4;
  transition: width 0.3s ease;
}

#storage-info {
  display: flex;
  align-items: center;
}

#storage-text {
  font-size: 12px;
  color: #5f6368;
}

.clear-button {
  background-color: #d93025;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.clear-button:hover {
  background-color: #b52d20;
}

.setting-item p {
  margin: 0;
  font-size: 14px;
  color: #5f6368;
}

/* File list grid view styles */
#file-list.grid-view {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 16px !important;
}

#file-list.grid-view li {
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#file-list.grid-view li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#file-list.grid-view .file-info {
  width: 100%;
  margin-bottom: 12px;
}

#file-list.grid-view .button-group {
  width: 100%;
  justify-content: space-between;
  margin-left: 0;
}

/* Dark theme grid styles */
body.dark-theme #file-list.grid-view li {
  background: #2d2d2d;
  border-color: #444;
}

/* Dark theme styles */
body.dark-theme {
  background: #121212;
  color: #ffffff;
}

body.dark-theme .top-bar {
  background-color: #1f1f1f;
  animation: none;
}

body.dark-theme .sidebar {
  background-color: #1f1f1f;
}

body.dark-theme .sidebar a {
  color: #e0e0e0;
}

body.dark-theme .sidebar a:hover {
  background-color: #2d2d2d;
}

body.dark-theme .sidebar a.active {
  background-color: #1a73e8;
  color: #ffffff;
}

body.dark-theme .main-content {
  background: #121212;
}

body.dark-theme #uploaded-files,
body.dark-theme #settings-content,
body.dark-theme .scrolling-stats {
  background: #1f1f1f;
  color: #ffffff;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3 {
  color: #ffffff;
}

body.dark-theme .file-name,
body.dark-theme .upload-date,
body.dark-theme .download-count,
body.dark-theme .scrolling-text,
body.dark-theme .setting-item label,
body.dark-theme .setting-item p,
body.dark-theme #storage-text {
  color: #ffffff;
}

body.dark-theme .top-bar input[type="text"] {
  background-color: #2d2d2d;
  color: #ffffff;
  border-color: #444;
}

body.dark-theme .setting-item select {
  background-color: #2d2d2d;
  color: #ffffff;
  border-color: #444;
}

/* Light theme text colors - explicitly set to ensure proper contrast */
body:not(.dark-theme) .file-name,
body:not(.dark-theme) .upload-date,
body:not(.dark-theme) .download-count,
body:not(.dark-theme) .scrolling-text,
body:not(.dark-theme) .setting-item label,
body:not(.dark-theme) .setting-item p,
body:not(.dark-theme) #storage-text,
body:not(.dark-theme) h1,
body:not(.dark-theme) h2,
body:not(.dark-theme) h3 {
  color: #000000;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar a {
    justify-content: center;
  }

  .sidebar a span {
    display: none;
  }

  .sidebar a img {
    margin-right: 0;
  }

  .top-bar {
    left: 60px;
  }

  .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
  }

  .sidebar a svg {
    width: 18px; /* Further reduced for smaller screens */
    height: 18px;
  }
}