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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

#app { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }

/* Login */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

#login-screen h1 { margin-bottom: 2rem; font-size: 1.5rem; }

#login-form {
  display: flex;
  gap: 0.5rem;
}

#login-form input {
  padding: 0.6rem 1rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 1rem;
  width: 280px;
}

button {
  padding: 0.6rem 1.2rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover { background: #2a2a2a; }

.error { color: #f44; margin-top: 0.5rem; }
.hidden { display: none !important; }

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

header h1 { font-size: 1.3rem; }

.header-actions { display: flex; gap: 0.5rem; }

/* Upload zone */
#upload-zone {
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

#upload-zone.dragover { border-color: #5b8def; background: rgba(91, 141, 239, 0.05); }

#upload-zone .link { color: #5b8def; cursor: pointer; text-decoration: underline; }

.upload-hint { margin-top: 0.5rem; font-size: 0.85rem; color: #666; }

/* Progress */
#upload-progress { margin-bottom: 1rem; }

.progress-bar {
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.progress-fill {
  height: 100%;
  background: #5b8def;
  width: 0%;
  transition: width 0.3s;
}

#upload-status { font-size: 0.85rem; color: #888; }

/* Section headings */
#content h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #222;
}

#bundles-section { margin-bottom: 2rem; }

/* Bundle cards */
.bundle-card {
  border: 1px solid #222;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: #141414;
  transition: border-color 0.2s;
}

.bundle-card:hover { border-color: #333; }

.bundle-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.bundle-thumb {
  width: 80px;
  height: 60px;
  border-radius: 4px;
  background: #222;
  object-fit: cover;
  flex-shrink: 0;
}

.bundle-thumb-placeholder {
  width: 80px;
  height: 60px;
  border-radius: 4px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.bundle-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.bundle-meta {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.5;
}

.bundle-meta span { margin-right: 0.75rem; }

/* Composite list */
.composite-list {
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  list-style: none;
}

.composite-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: #aaa;
}

.composite-name { color: #ccc; font-weight: 500; }

.composite-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: #1e2a3a;
  color: #6ba3f7;
}

.composite-tag.equirect { background: #1e2a1e; color: #6bf76b; }
.composite-tag.plane { background: #2a2a1e; color: #f7d06b; }

.composite-duration { color: #666; font-size: 0.8rem; }

/* Bundle file list (collapsible) */
.bundle-files {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #1e1e1e;
}

.bundle-files summary {
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.bundle-files summary:hover { color: #888; }

.bundle-file-list {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #666;
}

.bundle-file-list div {
  padding: 0.15rem 0;
  display: flex;
  justify-content: space-between;
}

.bundle-file-list .file-size { color: #555; }

/* Bundle actions */
.bundle-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e1e1e;
}

/* Table (loose files) */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #333;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

td {
  padding: 0.5rem;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.9rem;
}

td:nth-child(2), td:nth-child(3) { white-space: nowrap; color: #888; }

td:last-child { text-align: right; }

.action-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  margin-left: 0.3rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: transparent;
  color: #bbb;
}

.action-btn:hover { background: #2a2a2a; }
.action-btn.delete:hover { color: #f44; border-color: #f44; }

#file-count { margin-top: 1rem; font-size: 0.85rem; color: #666; }

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #222;
}

.modal-header h2 { font-size: 1rem; }

.modal-close {
  border: none;
  background: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}

.modal-close:hover { color: #e0e0e0; background: none; }

#modal-body {
  padding: 1.25rem;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #ccc;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}
