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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #2d3748;
  line-height: 1.6;
}

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

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.logo-link {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.header-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.header-text {
  text-align: left;
}

header h1 {
  color: #1a365d;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

header p {
  color: #4a5568;
  font-size: 1.1rem;
}

.message {
  background: #48bb78;
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.tabs {
  display: flex;
  background: white;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.tab-button {
  flex: 1;
  padding: 15px 20px;
  background: #e2e8f0;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background: #cbd5e0;
}

.tab-button.active {
  background: #3182ce;
  color: white;
}

.tab-content {
  display: none;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 400px;
}

.tab-content.active {
  display: block;
}

.card {
  padding: 30px;
}

.card h2 {
  color: #1a365d;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

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

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2d3748;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3182ce;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #718096;
  font-size: 0.9rem;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #3182ce;
  color: white;
}

.btn-primary:hover {
  background: #2c5aa0;
}

.btn-secondary {
  background: #4a5568;
  color: white;
}

.btn-secondary:hover {
  background: #2d3748;
}

.btn-danger {
  background: #e53e3e;
  color: white;
}

.btn-danger:hover {
  background: #c53030;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.btn-success {
  background: #38a169;
  color: white;
}

.btn-success:hover {
  background: #2f855a;
}

.add-participant-form {
  background: #f7fafc;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 30px;
}

.add-participant-form .form-row {
  align-items: end;
  margin-bottom: 0;
}

.add-participant-form input {
  margin-bottom: 0;
}

.table-container {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.participants-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.participants-table th,
.participants-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.participants-table th {
  background: #f7fafc;
  font-weight: 600;
  color: #2d3748;
}

.participants-table tr:hover {
  background: #f7fafc;
}

/* Added styles for inline editing functionality */
.editable-cell {
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
}

.editable-cell:hover {
  background: #edf2f7 !important;
}

.editable-cell:hover::after {
  content: "✏️";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.7;
}

.editable-name {
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
}

.editable-name:hover {
  background: #edf2f7 !important;
}

.editable-name:hover::after {
  content: "✏️";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.7;
}

.key-cell {
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  background: #f7fafc;
  color: #2d3748;
}

.no-data {
  text-align: center;
  color: #718096;
  font-style: italic;
}

.table-actions {
  margin-top: 20px;
  text-align: right;
}

.preview-actions {
  margin-bottom: 20px;
  text-align: center;
}

.certificate-preview {
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  padding: 20px;
  background: white;
  max-height: 600px;
  overflow-y: auto;
}

/* Certificate Styles */
.certificate {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  font-family: Arial, sans-serif;
  position: relative;
}

.certificate-header {
  text-align: right;
  margin-bottom: 30px;
  font-size: 14px;
  color: #666;
}

.certificate-title {
  text-align: center;
  margin-bottom: 40px;
}

.certificate-title h1 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #333;
}

.certificate-title h2 {
  font-size: 16px;
  color: #333;
  font-weight: normal;
}

.certificate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.certificate-table th,
.certificate-table td {
  border: 1px solid #333;
  padding: 8px 12px;
  text-align: left;
}

.certificate-table th {
  background: #f5f5f5;
  font-weight: bold;
}

.certificate-table .number-col {
  width: 80px;
  text-align: center;
}

.certificate-table .key-col {
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 0.1;
  font-size: 48px;
  color: #ccc;
  pointer-events: none;
  z-index: 1;
}

.export-section {
  background: #f7fafc;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  text-align: center;
}

.export-section h3 {
  color: #1a365d;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.export-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

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

  .header-text {
    text-align: center;
  }

  .header-logo {
    height: 35px;
  }

  .tabs {
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .add-participant-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .table-container {
    font-size: 0.9rem;
  }

  .participants-table th,
  .participants-table td {
    padding: 10px 8px;
  }

  .export-actions {
    flex-direction: column;
    align-items: center;
  }
}
