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

body {
  background: #fffff0;
  color: #2f4f4f;
  font-family: "Courier New", monospace;
  overflow-x: hidden;
  cursor: auto;
}

header {
  background-color: rgba(255, 255, 240, 0.98);
  color: #2f4f4f;
  padding: 1rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  color: #2f4f4f;
  display: flex;
  align-items: center;
}

header h1 i {
  color: #ffd700;
  margin-right: 10px;
}

.btn-header {
  position: relative;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(45deg, #ffd700, #fdb931);
  color: #2f4f4f;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header:hover {
  background: linear-gradient(45deg, #2f4f4f, #1a2f2f);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.btn-header i {
  font-size: 1.1rem;
}

main {
  padding: 6rem 0 2rem;
}

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

.welcome-section,
.profile-section,
.wallet-info {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-section {
  text-align: center;
  padding: 3rem;
  margin-bottom: 3rem;
}

.welcome-section h2 {
  margin-bottom: 1rem;
  color: #2f4f4f;
  font-size: 2.5rem;
}

.welcome-section p {
  margin-bottom: 2rem;
  color: #708090;
  font-size: 1.2rem;
}

.btn-main,
.btn-result,
.btn-vote-now {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: #ffd700;
  color: #2f4f4f;
  border: 2px solid #2f4f4f;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  text-decoration: none !important;
}

.btn-main:hover,
.btn-result:hover,
.btn-vote-now:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.btn-main::after,
.btn-result::after,
.btn-vote-now::after {
  content: "";
  position: absolute;
  left: -75%;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  transform: skewX(-20deg);
  transition: left 0.5s;
  pointer-events: none;
}

.btn-main:hover::after,
.btn-result:hover::after,
.btn-vote-now:hover::after {
  left: 120%;
  transition: left 0.5s;
}

.btn-result {
  background: linear-gradient(90deg, #ffd700 60%, #fcad11 100%);
  border: none;
  width: 100%;
  margin-top: 1.2rem;
}

.btn-vote-now {
  background: linear-gradient(90deg, #36ea81 60%, #00b74c 100%);
  border: none;
  width: 100%;
  margin-top: 1.2rem;
}

.btn,
.btn-secondary {
  display: block;
  width: 100%;
  padding: 1rem;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  border: none;
}

.btn {
  background-color: #3498db;
  color: white;
}

.btn:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  display: inline-block;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.hidden {
  display: none;
}

#wallet-address {
  margin-top: 1rem;
  padding: 0.5rem 0.8rem;
  background-color: #f8f9fa;
  border-radius: 5px;
  word-break: break-all;
  font-family: monospace;
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #2f4f4f;
}

#result-section,
#transaction-status,
#contract-address {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 5px;
  word-break: break-all;
  color: #27ae60;
  font-weight: 600;
}

.candidate-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.candidate-input input {
  flex: 1;
}

.remove-candidate {
  padding: 0.5rem;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.remove-candidate:hover {
  background-color: #c0392b;
}

#add-candidate {
  margin-top: 0.5rem;
}

.ongoing-votings-section {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 240, 0.98);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ongoing-votings-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #2f4f4f;
  font-size: 2rem;
}

.votings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.votings-hrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
  gap: 2rem;
}

.voting-card,
.candidate-card {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 215, 0, 0.3);
  animation: popIn 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.voting-card:hover,
.candidate-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.voting-card h3,
.voting-card h4 {
  color: #2f4f4f;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.voting-card p,
.candidate-card p {
  color: #708090;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.voting-card .status {
  display: inline-block;
  min-width: 50px;
  max-width: 85px;
  text-align: center;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1rem;
  white-space: nowrap;
}

.status-ongoing {
  background-color: #2ecc71;
  color: white;
}

.status-ended {
  background-color: #e74c3c;
  color: white;
}

.voting-card .time-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 215, 0, 0.3);
  font-size: 0.8rem;
  color: #708090;
}

.error-message {
  background-color: #fff3f3;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  color: #c62828;
  text-align: center;
}

.error-message p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.voting-card.error {
  background-color: #fff3f3;
  border: 1px solid #ffcdd2;
}

.voting-card.error h3,
.voting-card.error h4 {
  color: #c62828;
}

.voting-card.error .error-message {
  background-color: transparent;
  border: none;
  padding: 0.5rem 0;
  margin: 0;
  text-align: left;
}

footer {
  background: rgba(255, 255, 240, 0.95);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: #2f4f4f;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-section p {
  color: #708090;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #708090;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #ffd700;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border: 2px solid #ffd700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2f4f4f;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.social-icon:hover {
  background: #ffd700;
  color: #fffff0;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.footer-bottom p {
  color: #708090;
}

.voting-card .voting-id,
.voting-card .nft-contract {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  word-break: break-all;
}

.voting-card .contract-address,
.nft-owner-card .contract-address,
#voting-details-section .contract-address {
  color: #27ae60;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 1.01rem;
  word-break: break-all;
  max-width: 100%;
}

.nft-owner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.07),
    rgba(46, 204, 113, 0.07)
  );
  border: 1.5px solid #ffd70033;
  padding: 1.2rem 1.8rem;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  animation: fadeIn 0.7s;
  min-width: 0;
  gap: 1rem;
}

.nft-owner-card .status-icon {
  margin-left: 1.2rem;
  font-size: 1.7rem;
  vertical-align: middle;
  display: inline-block;
}
.nft-owner-card .status-icon .fa-check-circle {
  color: #27ae60;
}
.nft-owner-card .status-icon .fa-times-circle {
  color: #e74c3c;
}

#nft-owners-list.votings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

@media (max-width: 700px) {
  #nft-owners-list.votings-grid {
    grid-template-columns: 1fr;
  }
  .nft-owner-card {
    padding: 1rem 0.7rem;
    font-size: 0.95rem;
  }
  .candidate-vote-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 0.5rem;
  }
  #vote-form label {
    font-size: 1rem;
  }
}

#voting-details-section {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 2.2rem 2.5rem 2rem 2.5rem;
  margin-bottom: 2.5rem;
  border: 1.5px solid #ffd70033;
}
#voting-details-section h2 {
  text-align: center;
  color: #2f4f4f;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
#voting-details-section p {
  margin: 0.7rem 0;
  font-size: 1.08rem;
  color: #2f4f4f;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.candidate-vote-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.1rem;
  background: rgba(255, 255, 240, 0.7);
  border-radius: 7px;
  padding: 0.7rem 1.2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.314);
  border: 1px solid #ffd70033;
}
#vote-form label {
  font-size: 1.08rem;
  font-weight: 500;
  color: #2f4f4f;
  width: 100%;
  cursor: pointer;
}
#vote-form input[type="radio"] {
  accent-color: #27ae60;
  width: 1.1rem;
  height: 1.1rem;
}
#vote-actions .btn-main {
  margin: 0.5rem 0.5rem 0 0;
  min-width: 140px;
}
#vote-actions .btn-main[disabled],
#vote-actions .btn-main[style*="opacity:0.5"] {
  opacity: 0.5;
  pointer-events: none;
}
#vote-status {
  margin-top: 1.2rem;
  font-size: 1.08rem;
  font-weight: 500;
}

/* Wallet Dropdown Styles */
.wallet-dropdown,
.wallet-dropdown-content {
  position: relative;
  display: inline-block;
}
.wallet-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1000;
  margin-top: 0;
  padding: 8px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.wallet-dropdown:not(.wallet-connected) .wallet-dropdown-content {
  display: none !important;
}
.wallet-dropdown.wallet-connected:hover .wallet-dropdown-content {
  display: block;
}
.wallet-dropdown.wallet-connected::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
  pointer-events: none;
}
.wallet-dropdown.wallet-connected .wallet-dropdown-content:hover {
  display: block;
}
.wallet-dropdown.wallet-connected .wallet-dropdown-content::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
  pointer-events: none;
}
.wallet-dropdown-content button {
  color: #2f4f4f;
  padding: 12px 20px;
  text-decoration: none;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}
.wallet-dropdown-content button:hover {
  background-color: #f8f9fa;
  color: #ffd700;
}
.wallet-dropdown-content button i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}
.wallet-dropdown-content button:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.wallet-dropdown-content button:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.wallet-dropdown-content button:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.wallet-dropdown.wallet-connected .wallet-dropdown-content::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

/* Legacy Wallet Dropdown Styles (for backward compatibility) */
.wallet-dropdown-content {
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  z-index: 1;
}
.wallet-dropdown-content button {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  transition: background-color 0.3s;
}
.wallet-dropdown-content button:hover {
  background-color: #f1f1f1;
}
.wallet-dropdown:hover .wallet-dropdown-content {
  display: block;
}
.wallet-dropdown-content button i {
  margin-right: 8px;
  color: #666;
}

.profile-section {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 10px;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
  margin-left: auto;
  margin-right: auto;
}
.profile-section h2 {
  color: #2f4f4f;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: center;
}
.wallet-info {
  background: rgba(255, 255, 240, 0.98);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.wallet-info h3 {
  color: #2f4f4f;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.user-votings {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
#user-votings-list.votings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
#user-votings-list .voting-card {
  background: rgba(255, 255, 240, 0.98);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 215, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
#user-votings-list .voting-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}
@media (max-width: 1000px) {
  #user-votings-list.votings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.hidden {
  display: none !important;
}
@media (max-width: 700px) {
  #user-votings-list.votings-grid {
    grid-template-columns: 1fr;
  }
}
