@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 500px;
  padding: 12px;
}

header {
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.header-content {
  flex: 1;
  min-width: 180px;
}

.header-chibi {
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}

.chibi-animation {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
  border: 2px solid rgba(33, 150, 243, 0.5);
  transition: all 0.3s ease;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

header p {
  font-size: 0.85rem;
  opacity: 0.8;
}

.card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: perspective(1000px) rotateX(5deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.config-section {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 8px rgba(76, 175, 80, 0.1);
}

.config-section:hover {
  background: rgba(76, 175, 80, 0.15);
  box-shadow: inset 0 2px 8px rgba(76, 175, 80, 0.2);
}

.config-section h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  text-align: center;
}

.config-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.config-input input {
  flex: 1;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.config-input input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(76, 175, 80, 0.8);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.config-input input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.config-input button {
  padding: 9px 18px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.config-input button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.config-input button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.contract-status {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 3px;
}

.contract-status span {
  font-weight: 600;
  color: #FFD700;
  word-break: break-all;
}

.clear-cache-btn {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: #FF6B6B;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.clear-cache-btn:hover {
  background: #ee5a52;
  transform: scale(1.02);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
}

#walletAddress {
  font-weight: 600;
  word-break: break-all;
}

#connectBtn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#connectBtn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

#connectBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.voting-section {
  margin-bottom: 15px;
}

.voting-section h2 {
  margin-bottom: 12px;
  text-align: center;
  font-size: 1.05rem;
}

.options {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
  gap: 8px;
}

.option {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 45%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.option:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.option i {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.option p {
  font-size: 0.95rem;
}

.option.selected {
  background: rgba(33, 150, 243, 0.4);
  border: 2px solid #2196F3;
  box-shadow: 0 0 20px rgba(33, 150, 243, 0.4);
  transform: scale(1.05);
}

.vote-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.vote-btn:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(33, 150, 243, 0.5);
}

.vote-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
}

.vote-btn:disabled {
  background: linear-gradient(135deg, #888, #666);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.results-section h2 {
  margin-bottom: 15px;
  text-align: center;
}

.results {
  display: flex;
  justify-content: space-around;
  gap: 20px;
}

.result-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  flex: 1;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.result-item:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.result-item span:first-child {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
}

.result-item span:last-child {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  color: #FFD700;
}

.notification {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInUp 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.notification.success {
  background: rgba(76, 175, 80, 0.3);
  border: 1px solid #4CAF50;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

.notification.error {
  background: rgba(244, 67, 54, 0.3);
  border: 1px solid #f44336;
  box-shadow: 0 4px 20px rgba(244, 67, 54, 0.2);
}

.hidden {
  display: none !important;
  visibility: hidden !important;
}

/* Copy Button */
.copy-btn {
  background: none;
  border: none;
  color: #FFD700;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 8px;
  transition: all 0.3s ease;
  padding: 4px 8px;
}

.copy-btn:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

/* Refresh Button */
.refresh-btn {
  background: rgba(33, 150, 243, 0.2);
  border: 1px solid rgba(33, 150, 243, 0.4);
  color: #2196F3;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: rgba(33, 150, 243, 0.3);
  transform: rotate(180deg);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.results-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

/* Result Bar */
.result-bar {
  width: 100%;
  height: 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  margin: 7px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 8px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.result-count {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  color: #FFD700;
  text-align: center;
}

/* Vote Loading Spinner */
.vote-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(33, 150, 243, 0.2);
  border-radius: 8px;
  color: #2196F3;
  font-weight: 600;
  font-size: 0.9rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(33, 150, 243, 0.3);
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}