:root {
  --bg: #14151a;
  --bg-card: #1e1f26;
  --bg-hover: #262832;
  --accent: #4f9cf9;
  --accent2: #8b5cf6;
  --text: #e6e6ea;
  --text-dim: #9a9ba5;
  --border: #2c2e38;
  --danger: #ef4444;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #16171d, #1a1b22);
  color: var(--text);
  min-height: 100vh;
}
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-decoration: none;
}
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.2s; margin-bottom: 20px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(79, 156, 249, 0.06); }
.dropzone svg { width: 44px; height: 44px; opacity: 0.6; margin-bottom: 10px; }
.dropzone p { margin: 4px 0; color: var(--text-dim); }
.dropzone strong { color: var(--text); }
input[type="text"] {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 15px; width: 100%;
}
button, .btn {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: white; border: none; padding: 12px 20px; border-radius: 10px;
  font-weight: 600; cursor: pointer; font-size: 15px; transition: 0.15s transform;
  display: inline-block; text-decoration: none; text-align: center;
}
button:active, .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.folder-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--text); transition: 0.15s;
}
.folder-item:hover { background: var(--bg-hover); border-color: var(--accent); }
.folder-item .name { font-weight: 600; margin-bottom: 6px; }
.folder-item .meta { color: var(--text-dim); font-size: 13px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 20px; }
.file-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; cursor: pointer; position: relative; transition: 0.15s;
}
.file-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.file-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #0e0f13; }
.file-thumb.video-thumb { display: flex; align-items: center; justify-content: center; color: var(--text-dim); position: relative; }
.file-thumb.video-thumb svg { width: 40px; height: 40px; opacity: 0.8; }
.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
}
.play-badge svg {
  width: 36px;
  height: 36px;
  color: white;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
}
.file-info { padding: 8px 10px; }
.file-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.file-size { font-size: 11px; color: var(--text-dim); }
.delete-btn {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.6);
  border: none; color: white; border-radius: 50%; width: 26px; height: 26px;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-content { max-width: 95vw; max-height: 90vh; position: relative; }
.modal-content img, .modal-content video { max-width: 95vw; max-height: 88vh; border-radius: 8px; display: block; }
.modal-close {
  position: absolute; top: -40px; right: 0; background: none; border: none;
  color: white; font-size: 30px; cursor: pointer; line-height: 1;
}
.share-box { display: flex; gap: 8px; margin-top: 14px; }
.share-box input { flex: 1; }
.progress-wrap { margin-top: 14px; }
.progress-bar { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); width: 0%; transition: width 0.2s; }
.upload-item { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.empty-state { text-align: center; color: var(--text-dim); padding: 40px 0; }
@media (max-width: 480px) {
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px; }
  .dropzone { padding: 28px 12px; }
}
