* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.2em;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin-bottom: 20px;
  color: #667eea;
  font-size: 1.8em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.field-hint {
  display: block;
  font-size: 0.85em;
  color: #868e96;
  margin-top: 5px;
  font-style: italic;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.input-field {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 10px;
  margin-top: 10px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #ff6b6b;
  color: white;
}

.btn-secondary:hover {
  background: #ee5a52;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-success {
  background: #51cf66;
  color: white;
}

.btn-success:hover {
  background: #40c057;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(81, 207, 102, 0.4);
}

.btn-info {
  background: #4dabf7;
  color: white;
}

.btn-info:hover {
  background: #339af0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(77, 171, 247, 0.4);
}

.btn-outline {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-outline:hover {
  background: #f8f9fa;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
}

.search-results {
  margin-top: 20px;
}

.search-results h3 {
  color: #555;
  margin-bottom: 15px;
}

.member-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.member-card:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.member-info strong {
  font-size: 1.1em;
  color: #333;
}

.member-info span {
  font-size: 0.9em;
  color: #666;
}

.no-results {
  text-align: center;
  padding: 30px;
  background: #fff3cd;
  border-radius: 8px;
  margin-top: 20px;
}

.no-results p {
  margin-bottom: 15px;
  color: #856404;
}

.duplicate-checkin-popup {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
  border-radius: 15px;
  margin-top: 20px;
  border: 2px solid #ff6b6b;
  animation: slideDown 0.3s ease-out;
}

.popup-icon {
  font-size: 4em;
  margin-bottom: 15px;
  animation: pulse 1s infinite;
}

.duplicate-checkin-popup h3 {
  color: #c92a2a;
  font-size: 1.8em;
  margin-bottom: 20px;
}

.duplicate-info {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: left;
}

.duplicate-info p {
  margin: 10px 0;
  font-size: 1.1em;
  color: #333;
}

.duplicate-info strong {
  color: #667eea;
  display: inline-block;
  min-width: 130px;
}

.duplicate-message {
  color: #c92a2a;
  font-weight: 600;
  margin: 15px 0;
  font-size: 1.1em;
}

.popup-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.info-text {
  background: #e7f5ff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #1971c2;
  border-left: 4px solid #4dabf7;
}

.lucky-draw-section {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.eligible-count {
  margin-top: 15px;
}

.eligible-info {
  background: #d3f9d8;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.2em;
  color: #2b8a3e;
}

.winner-result {
  margin-top: 20px;
}

.winner-card {
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  color: white;
  animation: slideDown 0.5s ease-out;
}

.winner-card h3 {
  font-size: 2.5em;
  margin-bottom: 20px;
  animation: bounce 1s infinite;
}

.winner-details {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  color: #333;
}

.winner-details p {
  margin: 10px 0;
  font-size: 1.1em;
}

.small-text {
  font-size: 0.9em !important;
  color: #666 !important;
}

.drawing {
  text-align: center;
  font-size: 1.5em;
  padding: 20px;
  animation: pulse 1s infinite;
}

/* Table Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Filter Section Styles */
.filter-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-weight: 600;
  color: #555;
  font-size: 0.9em;
}

.filter-group select,
.filter-group input {
  width: 100%;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

thead {
  background: #f8f9fa;
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #dee2e6;
}

td {
  padding: 15px;
  border-bottom: 1px solid #dee2e6;
}

tbody tr {
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: #f8f9fa;
}

.loading, .no-data, .error {
  text-align: center;
  padding: 30px;
  color: #999;
  font-style: italic;
}

.error {
  color: #ff6b6b;
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.badge-member {
  background: #d3f9d8;
  color: #2b8a3e;
}

.badge-non-member {
  background: #ffe3e3;
  color: #c92a2a;
}

.badge-success {
  background: #d3f9d8;
  color: #2b8a3e;
}

.message-box {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 20px 30px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
}

.message-box.success {
  background: #51cf66;
  color: white;
}

.message-box.error {
  background: #ff6b6b;
  color: white;
}

.message-box.warning {
  background: #ffd43b;
  color: #333;
}

.message-box.info {
  background: #4dabf7;
  color: white;
}

.hidden {
  display: none;
}

footer {
  text-align: center;
  margin-top: 30px;
}

.admin-link, .footer-link {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  display: inline-block;
}

.admin-link:hover, .footer-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Voting Results Styles (for main page) */
.voting-result-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 4px solid #4dabf7;
}

.result-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.result-header-simple h4 {
  color: #f5576c;
  font-size: 1.5em;
  margin: 0;
}

.status-badge {
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.status-badge.active {
  background: #d3f9d8;
  color: #2b8a3e;
}

.status-badge.inactive {
  background: #e9ecef;
  color: #868e96;
}

.result-description {
  color: #666;
  margin-bottom: 10px;
  font-style: italic;
}

.total-votes {
  font-size: 1.1em;
  color: #495057;
  margin-bottom: 15px;
}

.total-votes strong {
  color: #f5576c;
  font-size: 1.3em;
}

.options-results {
  margin-top: 15px;
}

.option-result {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: transform 0.2s;
}

.option-result:hover {
  transform: translateX(5px);
}

.option-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.option-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
}

.option-total {
  color: #f5576c;
  font-weight: 600;
}

.vote-breakdown {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 0.9em;
}

.vote-type {
  padding: 4px 10px;
  border-radius: 5px;
}

.vote-type.member {
  background: #d3f9d8;
  color: #2b8a3e;
}

.vote-type.non-member {
  background: #ffe3e3;
  color: #c92a2a;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4dabf7, #339af0);
  transition: width 0.5s ease-out;
}

/* Responsive */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.8em;
  }
  
  .card {
    padding: 20px;
  }
  
  .member-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .message-box {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .vote-breakdown {
    flex-direction: column;
    gap: 5px;
  }

  .option-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .result-header-simple {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info {
  color: #555;
  font-size: 0.9em;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pagination-buttons button {
  min-width: 70px;
}

.pagination-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageNumbers {
  color: #667eea;
  font-size: 0.95em;
}

@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pagination-info {
    text-align: center;
  }
  
  .pagination-buttons {
    justify-content: center;
  }
}
