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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Login Section */
.login-box {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 60px 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.logo {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #1a1a1a;
  margin-bottom: 20px;
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 40px;
  color: #1a1a1a;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input[type="text"],
input[type="password"],
input[type="file"],
.rename-input {
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
.rename-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.error-message {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
  display: none;
}

.error-message.show {
  display: block;
}

/* Upload Section */
.upload-box {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 40px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e5e5e5;
}

.header > div:first-child {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-small {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #1a1a1a;
}

.upload-box h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.upload-section {
  margin-bottom: 40px;
}

.upload-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  flex-direction: column;
}

.file-label:hover {
  border-color: #1a1a1a;
  background-color: #f5f5f5;
  color: #1a1a1a;
}

.upload-icon {
  font-size: 24px;
  font-weight: 300;
}

@media (max-width: 600px) {
  .upload-buttons {
    grid-template-columns: 1fr;
  }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.breadcrumb-btn {
  background: none;
  border: none;
  color: #1976d2;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.breadcrumb-btn:hover {
  color: #1565c0;
  text-decoration: underline;
}

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

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  transition: all 0.2s;
}

.file-item:hover {
  background-color: #f9f9f9;
  border-color: #d0d0d0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.file-icon {
  font-size: 20px;
  color: #666;
  width: 24px;
  text-align: center;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: #1a1a1a;
  word-break: break-all;
}

.file-meta {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background-color: #1a1a1a;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #333333;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
  background-color: #e5e5e5;
  border-color: #999;
}

.btn-danger {
  background-color: #d32f2f;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-danger:hover {
  background-color: #b71c1c;
}

.btn-edit {
  background-color: #1976d2;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-edit:hover {
  background-color: #1565c0;
}

.btn-preview {
  background-color: #388e3c;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-preview:hover {
  background-color: #2e7d32;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border-radius: 8px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.modal-content p {
  color: #666;
  margin-bottom: 24px;
  word-break: break-word;
}

.rename-input {
  width: 100%;
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-buttons .btn {
  flex: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .login-box,
  .upload-box {
    padding: 30px 20px;
  }

  .header {
    flex-direction: column;
    gap: 20px;
  }

  .header > div:first-child {
    flex-direction: column;
    width: 100%;
  }

  .upload-box h1 {
    margin-bottom: 10px;
  }

  #logout-btn {
    width: 100%;
  }

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

  .file-actions {
    width: 100%;
  }

  .file-actions .btn {
    flex: 1;
  }

  .modal-content {
    padding: 30px 20px;
  }
}
