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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #303030;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0px auto 30px auto;
  background: white;
  padding: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 2.5em;
}

h2 {
  color: #555;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.upload-section,
.camera-section,
.list-section {
  margin-bottom: 40px;
  padding: 20px;
  background: #f8f9fa;
}

.list-section {
  margin-top: 50px;
}

.file-input-wrapper {
  margin-bottom: 20px;
}

input[type="file"] {
  display: none;
}

.file-label {
  display: inline-block;
  padding: 12px 24px;
  background: #667eea;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

.file-label:hover {
  background: #5568d3;
}

.file-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.preview-item {
  position: relative;
  border: 2px solid #ddd;
  padding: 10px;
  background: white;
}

.preview-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  margin-bottom: 8px;
}

.preview-item .filename {
  font-size: 0.85em;
  color: #666;
  word-break: break-all;
}

.preview-item .remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #e74c3c;
  color: white;
  border: none;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

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

.camera-section video {
  width: 100%;
  max-width: 640px;
  margin-bottom: 15px;
  background: black;
}

.photo-preview img {
  width: 100%;
  max-width: 640px;
  margin-bottom: 15px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.file-list {
  background: white;
  overflow: hidden;
}

.file-list table {
  width: 100%;
  border-collapse: collapse;
}

.file-list th {
  background: #667eea;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 500;
}

.file-list td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.file-list tr:hover {
  background: #f8f9fa;
}

.file-list .download-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9em;
}

.file-list .download-btn:hover {
  background: #218838;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 40px;
}

.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.message.success {
  background: #28a745;
}

.message.error {
  background: #e74c3c;
}

.hidden {
  display: none !important;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
