/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  body {
    background-color: #fff4ea;
    color: #333;
    line-height: 1.6;
  }
  
  /* Navigation bar styles */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #222;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .logo img {
    height: 40px;
  }
  
  .nav-container {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  
  .nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    font-weight: bold;
  }
  
  .nav-links a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    font-weight: bold;
  }
  
  .nav-links a:hover {
    color: #3498db;
  }
  
  .nav-links .active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
  }
  
  .contact-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
  }


  
  .connect-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .connect-btn:hover {
    background-color: #2980b9;
  }
  
  /* Dashboard container styles */
  .dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
  }
  
  .dashboard-container h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e6e6e6;
  }
  
  /* Dashboard stats styles */
  .dashboard-stats {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
  }
  
  .dashboard-stats h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
  }
  
  .dashboard-stats p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #555;
  }
  
  .dashboard-stats span {
    font-weight: 600;
    color: #3498db;
  }
  
  /* Election management styles */
  .manage-elections, .manage-candidates {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
  }
  
  .manage-elections h3, .manage-candidates h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
  }
  
  .manage-elections button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 1rem;
  }
  
  .manage-elections button:hover {
    background-color: #27ae60;
  }
  
  #endElectionBtn {
    background-color: #e74c3c;
  }
  
  #endElectionBtn:hover {
    background-color: #c0392b;
  }
  
  /* Form styles */
  #addCandidateForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  #addCandidateForm label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.3rem;
    display: block;
  }
  
  #addCandidateForm input, #addCandidateForm select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
  }
  
  #addCandidateForm button {
    grid-column: 1 / -1;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
  }
  
  #addCandidateForm button:hover {
    background-color: #2980b9;
  }

  
.election-tally {
  width: 100%;
  margin: 20px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.tab-button {
  padding: 10px 15px;
  background: #ddd;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

.tab-button.active {
  background: #007bff;
  color: white;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

/* Simple fade-in effect */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.candidates-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.candidates-table th, .candidates-table td {
  border: 1px solid #ccc;
  padding: 8px;
}

.candidates-table th {
  background: #007bff;
  color: white;
}
  
  /* Responsive design */
  @media (max-width: 768px) {
    .nav-container {
      flex-direction: column;
      gap: 1rem;
    }
    
    #addCandidateForm {
      grid-template-columns: 1fr;
    }
    
    .manage-elections button {
      display: block;
      width: 100%;
      margin-bottom: 0.5rem;
    }
  }

  /* Full-screen overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Ensure it's above everything */
  display: none; /* Initially hidden */
}

/* Loader animation (Spinner) */
.loader {
  width: 50px;
  height: 50px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

button:disabled {
  background-color: #ccc; /* Light gray background */
  color: #666; /* Dark gray text */
  cursor: not-allowed; /* Show not-allowed cursor */
  opacity: 0.6; /* Reduce opacity */
  border: 1px solid #999; /* Light gray border */
}