/* HSAAS Modern File Viewer Style */

#breadcrumb {
  background: var(--bg-card);
  margin: 0.5rem 1rem 1rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: var(--shadow-premium);
}

#breadcrumb span {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 1rem;
  padding: 0 1rem 8rem;
  max-width: 900px;
  margin: 0 auto;
}

.file-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-height: 130px;
  justify-content: center;
  box-shadow: var(--shadow-premium);
}

.file-card:active {
  transform: scale(0.95);
}

.file-card:hover {
  border-color: var(--primary);
}

.folder-thumb,
.file-icon {
  font-size: 2.25rem;
  color: var(--primary);
}

.file-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.file-name {
  padding: 0 0.5rem;
  font-size: 0.70rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.file-name .accent {
  display: block;
  font-weight: 1000;
  color: var(--primary);
  font-size: 0.85rem;
  text-wrap: nowrap;
  margin: 1px 0;
}

/* Modal UI Fixes */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-card);
  width: 100%;
  height: 85vh;
  max-width: 1000px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#close-viewer {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: var(--bg-card);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-premium);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-size: 1.2rem;
}

#file-viewer {
  width: 100%;
  height: 100%;
  border: none;
}