@font-face {
  font-family: 'CustomFont';
  src: url('/font.woff') format('woff');
}

:root {
  --base: #eff1f5;
  --text: #4c4f69;
  --rosewater: #dc8a78;
  --flamingo: #dd7878;
  --pink: #ea76cb;
  --mauve: #8839ef;
  --red: #d20f39;
  --maroon: #e64553;
  --peach: #fe640b;
  --yellow: #df8e1d;
  --green: #40a02b;
  --teal: #179299;
  --sky: #04a5e5;
  --sapphire: #209fb5;
  --blue: #1e66f5;
  --lavender: #7287fd;
  --crust: #dce0e8;
  --mantle: #e6e9ef;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --overlay0: #9ca0b0;
  --overlay1: #8c8fa1;
  --overlay2: #7c7f93;
  --subtext0: #6c6f85;
  --subtext1: #5c5f77;
}

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

body {
  font-family: 'CustomFont', system-ui, -apple-system, sans-serif;
  background-color: var(--base);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--mantle);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--surface0);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  color: var(--subtext0);
}

.logout-form {
  margin: 0;
}

button.btn {
  border: none;
  line-height: inherit;
}

.btn {
  background-color: var(--rosewater);
  color: var(--base);
  cursor: pointer;
  padding: 0.5rem 1rem 0.7rem;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
  font-family: inherit;
  transition: opacity 0.2s;
}


main {
  flex: 1;
  padding: 2rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  color: var(--text);
  margin-bottom: 1rem;
}

h2 {
  color: var(--mauve);
  margin-bottom: 0.5rem;
}

.card {
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.card p {
  margin-bottom: 1rem;
  color: var(--subtext0);
}

.btn:hover {
  opacity: 0.9;
}

.btn-primary {
  background-color: var(--rosewater);
  color: var(--base);
  border: none;
  cursor: pointer;
}

.auth-container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-weight: 500;
  color: var(--subtext0);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--surface1);
  border-radius: 4px;
  background-color: var(--base);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--rosewater);
  border-color: transparent;
}

.error-message {
  background-color: var(--red);
  color: var(--base);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
  color: var(--subtext0);
}

.auth-link a {
  color: var(--rosewater);
}



.settings-container {
  max-width: 600px;
  margin: 0 auto;
}

.settings-section {
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.settings-section h2 {
  margin-bottom: 1rem;
}

.settings-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--rosewater);
}

.error {
  background-color: var(--red);
  color: var(--base);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.upload-container {
  max-width: 500px;
  margin: 2rem auto;
}

.upload-card {
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 12px;
  padding: 2rem;
}

.upload-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--rosewater);
  margin-bottom: 0.75rem;
}

.upload-header h1 {
  margin-bottom: 0.25rem;
}

.upload-subtitle {
  color: var(--subtext0);
  font-size: 0.95rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dropzone {
  position: relative;
  border: 2px dashed var(--surface1);
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--rosewater);
  background-color: var(--base);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--overlay1);
}

.dropzone-text {
  font-weight: 500;
  color: var(--text);
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--subtext0);
}

.dropzone .file-name {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--rosewater);
  font-weight: 500;
}

.dropzone.has-file {
  border-color: var(--rosewater);
  border-style: solid;
}

.upload-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.upload-progress {
  margin-bottom: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.progress-bar-container {
  height: 8px;
  background-color: var(--surface0);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--rosewater);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-current {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--subtext0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-secondary {
  background-color: var(--surface0);
  color: var(--text);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary svg {
  flex-shrink: 0;
}

.files-container {
  max-width: 1200px;
  margin: 0 auto;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.file-card-wrapper {
  position: relative;
}

.file-card-wrapper:hover .file-card-actions {
  opacity: 1;
}

.file-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.file-card {
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.2s;
}

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

.file-icon {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rosewater);
  margin-bottom: 0.75rem;
}

.file-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--surface0);
}

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

.file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 0.75rem;
}

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

.delete-form {
  margin: 0;
}

.file-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: var(--surface0);
  color: var(--subtext0);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.file-action-btn:hover {
  background-color: var(--surface1);
  color: var(--text);
}

.file-action-btn.delete-btn:hover {
  background-color: var(--red);
  color: var(--base);
}

.file-action-btn.edit-btn:hover {
  background-color: var(--rosewater);
  color: var(--base);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--overlay1);
}

.empty-state svg {
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.folder-card {
  text-decoration: none;
  cursor: pointer;
  justify-content: center;
  min-height: 200px;
}

.folder-card .file-icon {
  color: var(--mauve);
  margin-bottom: 0.5rem;
}

.folder-card .file-icon svg {
  width: 48px;
  height: 48px;
}

.folder-card .file-name {
  margin-bottom: 0;
}

.folder-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.folder-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--subtext0);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

.file-card-link {
  text-decoration: none;
  cursor: pointer;
}

.file-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.file-detail-container .back-link {
  margin-bottom: 1.5rem;
}

.image-preview,
.video-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.image-preview img,
.video-preview video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.file-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.file-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.file-description {
  color: var(--subtext0);
  font-size: 1rem;
}

.file-detail-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-detail-actions .delete-form {
  margin: 0;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-action svg {
  flex-shrink: 0;
}

.btn-action-edit {
  background-color: var(--rosewater);
  color: var(--base);
}

.btn-action-edit:hover {
  background-color: var(--flamingo);
}

.btn-action-download {
  background-color: var(--surface0);
  color: var(--text);
  border-color: var(--surface1);
}

.btn-action-download:hover {
  background-color: var(--surface1);
}

.btn-action-delete {
  background-color: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-action-delete:hover {
  background-color: var(--red);
  color: var(--base);
}

.btn-danger {
  background-color: var(--red);
  color: var(--base);
  border: none;
  cursor: pointer;
}

.search-bar {
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  max-width: 400px;
}

.search-input-wrapper svg {
  color: var(--overlay1);
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.search-input-wrapper input::placeholder {
  color: var(--overlay0);
}

.search-input-wrapper:focus-within {
  border-color: var(--rosewater);
}

.search-input-wrapper:focus-within svg {
  color: var(--rosewater);
}

.search-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--overlay1);
  font-size: 1rem;
}

.file-folder-badge {
  font-size: 0.75rem;
  color: var(--subtext0);
  background-color: var(--surface0);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

