* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd2db; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #2a2d40; }

/* Drag overlay */
.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(51, 102, 255, 0.08);
  border: 3px dashed #3366ff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: dragPulse 1.5s ease-in-out infinite;
}

@keyframes dragPulse {
  0%, 100% { border-color: #3366ff; background: rgba(51, 102, 255, 0.06); }
  50% { border-color: #5990ff; background: rgba(51, 102, 255, 0.12); }
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 200;
  min-width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 6px;
  animation: menuIn 0.15s ease-out;
}

.dark .context-menu {
  background: #1e2030;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}

.context-menu button {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s;
}

.context-menu button:hover {
  background: #eef4ff;
}

.dark .context-menu button:hover {
  background: #262840;
}

@keyframes menuIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow: auto;
  animation: modalIn 0.25s ease-out;
}

.dark .modal-content {
  background: #1e2030;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

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

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Upload toast */
.upload-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 180;
  min-width: 320px;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.dark .upload-toast {
  background: #1e2030;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card hover */
.file-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.dark .file-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Star animation */
@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.star-pop {
  animation: starPop 0.3s ease;
}

/* Staggered fade-in for items */
@keyframes itemFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.item-enter {
  animation: itemFadeIn 0.3s ease-out both;
}

/* New button dropdown */
.new-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  padding: 6px;
  z-index: 50;
  animation: menuIn 0.15s ease-out;
}

.dark .new-dropdown {
  background: #1e2030;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: #e2e5eb;
  border-radius: 2px;
  overflow: hidden;
}

.dark .progress-bar {
  background: #262840;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3366ff, #5990ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Checkbox */
.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #cdd2db;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.custom-checkbox.checked {
  background: #3366ff;
  border-color: #3366ff;
}

.dark .custom-checkbox {
  border-color: #3a3d52;
}

/* Responsive sidebar */
@media (max-width: 768px) {
  .sidebar-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 40;
  }
}

/* Breadcrumb */
.breadcrumb-item {
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb-item:hover {
  color: #3366ff;
}

/* Row hover in list view */
.list-row:hover {
  background: #f0f2f6;
}

.dark .list-row:hover {
  background: #1a1c2e;
}

/* Footer */
footer a {
  color: #3366ff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}