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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}

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

/* Header Styles */
header {
  background-color: #0056b3;
  color: #fff;
  text-align: center;
  padding: 20px 0;
  margin-bottom: 30px;
  border-radius: 5px;
}

header h1 {
  margin-bottom: 5px;
}



.admin-controls {
  text-align: right;
  margin-right: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0056b3;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
}

.btn:hover {
  background-color: #003d82;
}

.btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #0056b3;
}

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

.btn-danger {
  background-color: #dc3545;
}

/* Message Styles */
.error-message {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  display: none;
}

.success-message {
  color: #28a745;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  display: none;
}

.loading-message {
  text-align: center;
  padding: 20px;
  color: #6c757d;
}

/* Login Form Styles */
.login-form {
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 0 auto;
}

.login-form h2 {
  margin-bottom: 20px;
  text-align: center;
}

/* OTP Verification Styles */
.verification-form {
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: 0 auto;
}

.verification-form h2 {
  margin-bottom: 20px;
  text-align: center;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.otp-input {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  border: 2px solid #ddd;
  border-radius: 5px;
}

/* Voting Styles */
.voting-form {
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.voting-form h2 {
  margin-bottom: 10px;
}

.position-section {
  margin-bottom: 30px;
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 20px;
}

.position-section.error {
  border-color: #dc3545;
}

.position-title {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.candidate-card {
  border: 2px solid #eee;
  border-radius: 5px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.candidate-card:hover {
  border-color: #0056b3;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.candidate-card.selected {
  border-color: #0056b3;
  background-color: #e6f2ff;
}

.candidate-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
}

.candidate-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.candidate-info {
  font-size: 14px;
  color: #666;
}

.no-candidates, .no-positions {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
}

.position-error {
  color: #dc3545;
  margin-top: -10px;
  margin-bottom: 10px;
  font-size: 14px;
}

/* Confirmation Styles */
.confirmation-page {
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.confirmation-icon {
  font-size: 60px;
  color: #28a745;
  margin-bottom: 20px;
}

.vote-details {
  margin: 30px 0;
  text-align: left;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.action-buttons {
  margin-top: 30px;
}

/* Already Voted */
.already-voted {
  text-align: center;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 30px;
}

/* Admin Dashboard Styles */
.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-card {
  background-color: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.stats-display {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #0056b3;
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
}

.admin-links {
  list-style: none;
}

.admin-links li {
  margin-bottom: 10px;
}

.admin-links a {
  color: #0056b3;
  text-decoration: none;
}

.admin-links a:hover {
  text-decoration: underline;
}

.admin-message {
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  display: none;
}

.admin-message.error {
  background-color: #f8d7da;
  color: #dc3545;
  border: 1px solid #f5c6cb;
}

.admin-message.success {
  background-color: #d4edda;
  color: #28a745;
  border: 1px solid #c3e6cb;
}

.admin-message.info {
  background-color: #e6f2ff;
  color: #0056b3;
  border: 1px solid #b8daff;
}

/* Election Status Styles */
.election-status-container {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 5px;
  background-color: #f8f9fa;
}

.status-active {
  border-left: 4px solid #28a745;
  padding-left: 15px;
}

.status-active h3 {
  color: #28a745;
}

.status-ended {
  border-left: 4px solid #dc3545;
  padding-left: 15px;
}

.status-ended h3 {
  color: #dc3545;
}

.status-not-started {
  border-left: 4px solid #ffc107;
  padding-left: 15px;
}

.status-not-started h3 {
  color: #ffc107;
}

.election-ended, .election-not-started {
  text-align: center;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 20px;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.data-table th, .data-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.data-table tr:hover {
  background-color: #f5f5f5;
}

.data-table tr.winner {
  background-color: #d4edda;
}

/* Results Display */
.position-results {
  margin-bottom: 30px;
  background-color: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-summary-list {
  list-style: none;
}

.result-summary-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.result-summary-list li:last-child {
  border-bottom: none;
}

.result-summary-list li.winner {
  font-weight: bold;
  color: #28a745;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
}

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

.user-controls, .admin-controls {
  margin-left: auto;
}

/* Add these styles to your CSS file */
.position-section {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Even-numbered positions */
.position-section:nth-child(even) {
  background-color: #f0f7ff; /* Light blue */
}

/* Odd-numbered positions */
.position-section:nth-child(odd) {
  background-color: #fff5f5; /* Light red/pink */
}

/* Additional styling to make the positions more visually appealing */
.position-title {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 1.4em;
}

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}

.candidate-card {
  transition: transform 0.2s ease-in-out;
}

.candidate-card:hover {
  transform: translateY(-5px);
}

/* Footer Styles */
footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px 0;
  color: #6c757d;
  border-top: 1px solid #eee;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
  .candidate-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .candidate-photo {
    width: 100px;
    height: 100px;
  }
  
  .admin-dashboard {
    grid-template-columns: 1fr;
  }
  
  .otp-input {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .login-form, .verification-form, .voting-form, .confirmation-page {
    padding: 15px;
  }
  
  .candidate-list {
    grid-template-columns: 1fr;
  }
  
  .stats-display {
    flex-direction: column;
    gap: 15px;
  }
}