/* Wallet Connect Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
}

.wallet-connect-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 20px;
}

.wallet-connect-header {
  text-align: center;
  color: white;
  margin-bottom: 50px;
}

.back-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 20px;
  transition: opacity 0.3s ease;
}

.back-link:hover {
  opacity: 0.8;
}

.wallet-connect-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.wallet-connect-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.wallet-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: 140px;
}

.wallet-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  background: #f8f9ff;
}

.wallet-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 2px solid white;
}

.wallet-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.wallet-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: #333;
  word-wrap: break-word;
}

.wallet-item.active .wallet-name {
  color: white;
}

/* ==================== MODAL STYLES ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #000;
}

.modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #333;
}

.modal-content p {
  color: #666;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.form-subtitle {
  margin-bottom: 25px !important;
  font-size: 0.9rem !important;
}

.manual-connect-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.manual-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== FORM STYLES ==================== */

.form-modal {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.auto-save-notice {
  background: #f0f4ff;
  border-left: 4px solid #667eea;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  color: #667eea;
  font-size: 0.9rem;
  font-weight: 500;
}

.submit-message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  animation: slideDown 0.3s ease;
}

.submit-message.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.submit-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.submit-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .wallet-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
  }

  .wallet-connect-header h1 {
    font-size: 2rem;
  }

  .modal-content {
    padding: 30px 20px;
    width: 95%;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .wallet-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
  }

  .wallet-connect-header h1 {
    font-size: 1.5rem;
  }

  .wallet-connect-header p {
    font-size: 1rem;
  }

  .wallet-icon {
    font-size: 2rem;
  }

  .wallet-name {
    font-size: 0.7rem;
  }

  .wallet-item {
    padding: 15px;
    min-height: 120px;
  }

  .modal-content {
    padding: 25px 15px;
    width: 95%;
  }

  .modal-content h2 {
    font-size: 1.3rem;
  }

  .modal-content p {
    font-size: 0.9rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.9rem;
    padding: 10px;
  }
}
