/* Reset and Base Styles */
:root {
  --primary-color: #3b82f6; /* Vibrant blue */
  --secondary-color: #60a5fa; /* Lighter blue for hover */
  --text-color: #ffffff;
  --text-secondary: #d1d5db; /* Softer gray for secondary text */
  --bg-dark: #0f172a; /* Darker, sleeker background */
  --bg-card: #1e293b; /* Card background */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient: linear-gradient(135deg, #1e3a8a, #3b82f6);
  --error-bg: #ef4444; /* Red background for errors */
  --error-text: #ffffff; /* White text for errors */
}

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

body {
  min-height: 100vh;
  background: var(--gradient);
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  overflow-x: hidden;
}

/* Card */
.card {
  max-width: 600px;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.2), transparent 70%);
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Logo */
.logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 2rem;
  transition: var(--transition);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo:hover {
  transform: scale(1.1);
}

/* Typography */
.title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.title-span {
  font-weight: 700;
}

.description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Error Container */
.error-container {
  margin-top: 1.5rem;
  min-height: 1.5rem;
  transition: opacity 0.3s ease;
}

.error-message {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s ease-in;
}

/* Buttons */
.connect-button {
  gap: 1rem;
}

.wallet-button,
.action-button,
.disconnect-button {
  width: 100%;
  max-width: 300px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--primary-color);
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.disconnect-button {
  background: #ef4444; /* Red for disconnect */
}

.wallet-button:hover,
.action-button:hover,
.disconnect-button:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.disconnect-button:hover {
  background: #f87171; /* Lighter red for hover */
}

.wallet-button:active,
.action-button:active,
.disconnect-button:active {
  transform: translateY(0);
}

/* Web3Modal Button */
w3m-button {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 300px !important;
  height: 48px !important;
}

w3m-button *,
w3m-button button,
w3m-button div {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px !important;
  background: var(--primary-color) !important;
  color: var(--text-color) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
  transition: var(--transition) !important;
  border: none !important;
}

w3m-button *:hover,
w3m-button button:hover,
w3m-button div:hover {
  background: var(--secondary-color) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
  }

  .logo {
    max-width: 150px;
  }

  .title {
    font-size: 2rem;
  }

  .description {
    font-size: 1rem;
  }

  .wallet-button,
  .action-button,
  .disconnect-button {
    max-width: 100%;
  }

  w3m-button,
  w3m-button *,
  w3m-button button,
  w3m-button div {
    max-width: 100% !important;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 1rem;
  }

  .logo {
    max-width: 120px;
  }

  .title {
    font-size: 1.75rem;
  }

  .connect-button {
    flex-direction: column;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.error-message {
  animation: fadeIn 0.5s ease-in;
}