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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #1e1b4b 0%, #581c87 50%, #0f172a 100%);
  min-height: 100vh;
  color: #e2e8f0;
  overflow-x: hidden;
}

/* Cosmic Background Effects */
.cosmic-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.star-1 {
  top: 40px;
  left: 40px;
  width: 8px;
  height: 8px;
  background: #a855f7;
}

.star-2 {
  top: 128px;
  right: 80px;
  width: 4px;
  height: 4px;
  background: #93c5fd;
  animation-delay: 1s;
}

.star-3 {
  bottom: 160px;
  left: 25%;
  width: 6px;
  height: 6px;
  background: #f472b6;
  animation-delay: 0.5s;
}

.star-4 {
  top: 50%;
  right: 33%;
  width: 4px;
  height: 4px;
  background: #67e8f9;
  animation-delay: 0.7s;
}

.star-5 {
  bottom: 80px;
  right: 40px;
  width: 8px;
  height: 8px;
  background: #c084fc;
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Header */
.header {
  position: relative;
  z-index: 10;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.8) 0%, rgba(49, 46, 129, 0.8) 50%, rgba(88, 28, 135, 0.8) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.header-content {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-container {
  position: relative;
}

.logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.logo-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #67e8f9;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.main-title {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(90deg, #e9d5ff, #fce7f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 14px;
  color: #c084fc;
}

/* Main Container */
.main-container {
  display: flex;
  height: calc(100vh - 100px);
  position: relative;
  z-index: 10;
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.4) 0%, rgba(49, 46, 129, 0.4) 100%);
  backdrop-filter: blur(8px);
  border-right: 1px solid rgba(168, 85, 247, 0.2);
  padding: 16px;
  overflow-y: auto;
}

.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #e9d5ff;
  user-select: none;
}

.folder-item:hover {
  background: rgba(88, 28, 135, 0.3);
}

.folder-item.active {
  background: rgba(88, 28, 135, 0.4);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.folder-item.child {
  padding-left: 32px;
}

.folder-item.child-2 {
  padding-left: 48px;
}

.folder-item.child-3 {
  padding-left: 64px;
}

.folder-item i {
  color: #a855f7;
  width: 16px;
}

/* Calendar icon styling */
.folder-item i.fa-calendar {
  color: #67e8f9;
}

.expand-icon {
  margin-left: auto;
  transition: transform 0.2s;
}

.folder-item.expanded .expand-icon {
  transform: rotate(90deg);
}

.folder-children {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.folder-children.expanded {
  display: flex;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-header {
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  padding: 16px;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.3) 0%, rgba(49, 46, 129, 0.3) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.breadcrumb a {
  color: #c084fc;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}

.breadcrumb a:hover {
  color: #e9d5ff;
}

.breadcrumb .separator {
  color: #8b5cf6;
}

.breadcrumb .current {
  color: #e9d5ff;
}

.view-controls {
  display: flex;
  gap: 8px;
}

.view-btn {
  padding: 8px;
  border: 1px solid rgba(168, 85, 247, 0.5);
  background: transparent;
  color: #c084fc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  background: rgba(88, 28, 135, 0.3);
}

.view-btn.active {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  color: white;
  border-color: transparent;
}

/* File Container */
.file-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #c084fc;
}

.loading i {
  font-size: 32px;
  margin-bottom: 16px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-card {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(49, 46, 129, 0.4) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
}

.file-thumbnail {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.5) 0%, rgba(49, 46, 129, 0.5) 100%);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.file-card:hover .file-thumbnail img {
  transform: scale(1.05);
}

.file-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(88, 28, 135, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.file-card:hover .file-overlay {
  opacity: 1;
}

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

.file-name {
  font-weight: 600;
  color: #e9d5ff;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid;
}

.file-badge.procedural {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
}

.file-badge.official {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.5);
}

.file-badge.community {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.5);
}

.file-badge.event {
  background: rgba(103, 232, 249, 0.2);
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.5);
}

.file-size {
  font-size: 12px;
  color: #a855f7;
}

.file-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #a855f7;
}

.file-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.file-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.file-btn.primary {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  color: white;
}

.file-btn.primary:hover {
  background: linear-gradient(90deg, #7c3aed, #db2777);
}

.file-btn.secondary {
  background: transparent;
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.file-btn.secondary:hover {
  background: rgba(88, 28, 135, 0.3);
}

/* List View */
.file-list-item {
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.3) 0%, rgba(49, 46, 129, 0.3) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-list-item:hover {
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.5);
}

.file-list-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-list-thumbnail {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.5) 0%, rgba(49, 46, 129, 0.5) 100%);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.file-list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-list-info {
  flex: 1;
  min-width: 0;
}

.file-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.file-list-header i {
  color: #a855f7;
}

.file-list-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: #c084fc;
  margin-bottom: 8px;
}

.file-list-details {
  font-size: 12px;
  color: #a855f7;
}

.file-list-actions {
  display: flex;
  gap: 8px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 256px;
  color: #c084fc;
  text-align: center;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 14px;
}

/* Modal with Zoom */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.95) 0%, rgba(49, 46, 129, 0.95) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  margin: 2% auto;
  padding: 0;
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  color: #e9d5ff;
  margin: 0;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-btn {
  background: rgba(88, 28, 135, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.zoom-btn:hover {
  background: rgba(88, 28, 135, 0.7);
  border-color: rgba(168, 85, 247, 0.7);
}

.zoom-level {
  color: #e9d5ff;
  font-size: 14px;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

.modal-close {
  background: none;
  border: none;
  color: #c084fc;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
}

.image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 20px;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.image-container img:active {
  cursor: grabbing;
}

.image-container.zoomed img {
  max-width: none;
  max-height: none;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.95) 0%, rgba(49, 46, 129, 0.95) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 8px 0;
  z-index: 1000;
  display: none;
  min-width: 180px;
}

.context-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e9d5ff;
  font-size: 14px;
  transition: background 0.2s;
}

.context-item:hover {
  background: rgba(88, 28, 135, 0.5);
}

.context-item.danger {
  color: #f472b6;
}

.context-item i {
  width: 16px;
}

/* Footer */
.footer {
  position: relative;
  z-index: 10;
  background: linear-gradient(90deg, rgba(88, 28, 135, 0.8) 0%, rgba(49, 46, 129, 0.8) 50%, rgba(88, 28, 135, 0.8) 100%);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  color: #c084fc;
  padding: 16px 24px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
}

.footer-content a {
  color: #c084fc;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-content a:hover {
  color: #e9d5ff;
}

/* Responsive */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .content-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .view-controls {
    justify-content: center;
  }

  .zoom-controls {
    display: none;
  }

  .modal-content {
    width: 98%;
    height: 95vh;
  }
}
