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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.subtitle {
  text-align: center;
  color: #666;
  font-size: 1.1em;
  margin-bottom: 30px;
}

.back-link {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  margin-bottom: 20px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.buttons {
  text-align: center;
  margin: 30px 0;
}

.btn {
  display: inline-block;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.info-box {
  background: #f8f9ff;
  border-radius: 10px;
  padding: 30px;
  margin-top: 30px;
}

.info-box h2 {
  color: #667eea;
  margin-bottom: 20px;
}

.info-box ol {
  margin-left: 20px;
}

.info-box li {
  margin-bottom: 10px;
  line-height: 1.6;
  color: #555;
}

/* Admin Form */
.form-container {
  background: #f8f9ff;
  border-radius: 10px;
  padding: 30px;
  margin: 30px 0;
}

.form-group {
  margin-bottom: 25px;
}

label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

textarea,
input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

textarea {
  resize: vertical;
}

.preview {
  margin-top: 10px;
  min-height: 50px;
}

.preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 10px;
}

.preview audio {
  margin-top: 10px;
  width: 100%;
}

/* Result */
.result {
  background: #e8f5e9;
  border-radius: 10px;
  padding: 30px;
  margin: 30px 0;
  text-align: center;
}

.result h2 {
  color: #2e7d32;
  margin-bottom: 20px;
}

.result-content {
  display: flex;
  gap: 30px;
  margin: 20px 0;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

.qr-container {
  flex: 1;
  min-width: 250px;
}

.qr-container img {
  max-width: 250px;
  border: 3px solid #333;
  border-radius: 10px;
  margin-bottom: 15px;
}

.url-info {
  flex: 1;
  min-width: 300px;
}

.url-box {
  display: flex;
  gap: 10px;
  margin: 10px 0 20px 0;
}

.url-box input {
  flex: 1;
}

/* Pages List */
.pages-list {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.pages-list h2 {
  color: #333;
  margin-bottom: 20px;
}

.page-item {
  background: #f8f9ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.page-info {
  flex: 1;
}

.page-info p {
  margin: 5px 0;
  color: #666;
}

.page-item .btn {
  padding: 8px 16px;
  font-size: 0.9em;
}

/* Gift Page */
.gift-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.gift-content {
  background: white;
  border-radius: 20px;
  padding: 50px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.loading {
  color: #667eea;
  font-size: 1.2em;
  padding: 40px;
}

.text-content {
  font-size: 1.3em;
  line-height: 1.8;
  color: #333;
  margin: 30px 0;
  white-space: pre-wrap;
}

.image-container {
  margin: 30px 0;
}

.image-container img {
  max-width: 100%;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.audio-container {
  margin: 30px 0;
}

.audio-container audio {
  width: 100%;
  max-width: 500px;
}

.error {
  color: #d32f2f;
  font-size: 1.2em;
  padding: 40px;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Upload progress indicator */
.upload-progress {
  margin-top: 10px;
  padding: 10px;
  background: #e3f2fd;
  border-radius: 8px;
  color: #1976d2;
  font-weight: 500;
  text-align: center;
  display: none;
}

/* -------------------------------------------------
   Responsive Design
--------------------------------------------------- */

@media (max-width: 768px) {
  .container,
  .gift-content {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .result-content {
    flex-direction: column;
  }

  .page-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
