* {
  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, #f5f1eb 0%, #f9f7f4 100%);
  min-height: 100vh;
  color: #2d3748;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
}

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

.page-header {
  text-align: center;
  margin-bottom: 40px;
  color: #78643a;
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.page-header h1 {
  font-size: 36px;
  margin-bottom: 8px;
  color: #78643a;
  font-weight: 700;
}

.subtitle {
  font-size: 18px;
  opacity: 1;
  color: #a09080;
  font-weight: 500;
}

/* Filters section */
.filters-section {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}



.add-result-btn:hover {
  background: linear-gradient(135deg, #78643a 0%, #6a5530 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(120, 100, 58, 0.4);
}

/* Row 1: search + competition (most used) */
.filters-row-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Row 2: smaller filters in equal columns */
.filters-row-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: #2d3748;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #a88264;
  box-shadow: 0 0 0 3px rgba(168, 130, 100, 0.1);
}

.filter-input::placeholder {
  color: #a0aec0;
}

.filter-select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 24px;
  margin-bottom: 24px;
  color: #2d3748;
}

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

.card-header h2 {
  margin: 0;
}

.competition-selector select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

/* Changed select focus border to brown */
.competition-selector select:focus {
  outline: none;
  border-color: #a88264;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s;
  background: white;
}

/* Changed hover border to brown */
.participant-item:hover {
  border-color: #a88264;
  box-shadow: 0 2px 8px rgba(168, 130, 100, 0.1);
}

.participant-item.has-result {
  background: linear-gradient(135deg, #f0fff4 0%, #e6f9ea 100%);
  border-color: #48bb78;
}

.participant-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

/* Changed avatar gradient to brown */
.participant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b7355 0%, #78643a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.participant-avatar img {
  display: none;
}

.participant-details {
  flex: 1;
}

.participant-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 16px;
  margin-bottom: 4px;
}

.participant-grade {
  font-size: 14px;
  color: #718096;
}

.result-info {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-right: 16px;
}

.result-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: white;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.result-label {
  font-size: 12px;
  color: #718096;
  margin-bottom: 4px;
}

.result-value {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
}

.result-value.place {
  color: #f59e0b;
  font-weight: 700;
}

.result-value.score {
  color: #10b981;
}

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

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

/* Changed primary button to brown gradient */
.btn-primary {
  background: linear-gradient(135deg, #8b7355 0%, #78643a 100%);
  color: white;
}

.btn-primary:hover {
  background: #78643a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(120, 100, 58, 0.4);
}

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

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

.btn-warning {
  background: #f59e0b;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: #fc8181;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: #718096;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #4a5568;
}

.no-result-badge {
  padding: 6px 12px;
  background: #fed7d7;
  color: #c53030;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 24px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #718096;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #2d3748;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 24px;
  border-top: 2px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

/* Changed form focus border to brown */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #a88264;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Enhanced responsive design for all devices */

/* Added styles for filters */
.filters-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.filter-group input,
.filter-group select {
  padding: 12px;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s;
}

/* Changed filter focus border to brown */
.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #a88264;
}

/* Added confirmed badge style */
.confirmed-badge {
  padding: 8px 16px;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Added success button style */
.btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
}

.btn-success:hover {
  background: #38a169;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

@media (max-width: 1024px) {
  .main-container {
    padding: 32px 16px;
  }

  .card {
    padding: 28px;
  }

  .page-header {
    padding: 28px 16px;
  }

  .filters-row-top {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .filters-row-bottom {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }
}

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

  .page-header {
    margin-bottom: 32px;
    padding: 24px 16px;
    border-radius: 12px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .card {
    padding: 24px;
    margin-bottom: 20px;
  }

  .card h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .card-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .card-header button {
    width: 100%;
  }

  .competition-selector select {
    font-size: 14px;
  }

  .participant-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .participant-info {
    width: 100%;
  }

  .result-info {
    width: 100%;
    justify-content: space-around;
    margin-right: 0;
    gap: 16px;
  }

  .result-badge {
    padding: 6px 12px;
  }

  .result-label {
    font-size: 11px;
  }

  .result-value {
    font-size: 16px;
  }

  .participant-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .participant-actions button {
    flex: 1;
    min-width: 120px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-header {
    padding: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 20px;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }

  .empty-state {
    padding: 40px 16px;
  }

  /* Make filters stack on mobile */
  .filters-section {
    padding: 16px;
  }

  .filters-row-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filters-row-bottom {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .add-result-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  .filter-input,
  .filter-select {
    padding: 11px 14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 20px 12px;
  }

  .page-header {
    margin-bottom: 24px;
    padding: 20px 12px;
    border-radius: 10px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 14px;
  }

  .card {
    padding: 20px;
    border-radius: 10px;
  }

  .card h2 {
    font-size: 18px;
  }

  .participant-item {
    padding: 12px;
  }

  .participant-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .participant-name {
    font-size: 14px;
  }

  .participant-grade {
    font-size: 12px;
  }

  .result-info {
    gap: 12px;
  }

  .result-badge {
    padding: 4px 10px;
  }

  .result-label {
    font-size: 10px;
  }

  .result-value {
    font-size: 14px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .btn-warning,
  .btn-danger {
    padding: 6px 12px;
    font-size: 12px;
  }

  .modal-content {
    width: 98%;
    max-height: 90vh;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-close {
    font-size: 28px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 16px;
  }

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

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px;
    font-size: 14px;
  }

  .empty-state {
    padding: 32px 12px;
  }

  .empty-state h3 {
    font-size: 18px;
  }

  .add-result-btn {
    padding: 12px;
    font-size: 14px;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .page-header h1 {
    font-size: 22px;
  }

  .participant-actions {
    flex-direction: column;
  }

  .participant-actions button {
    width: 100%;
  }

  .result-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-header {
    padding: 16px 10px;
  }

  .subtitle {
    font-size: 13px;
  }
}
