/* <style> */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000;
  color: #fff;
  min-height: 100vh;
}

.app-container {
  max-width: 428px;
  margin: 0 auto;
  min-height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.header {
  background: #000;
  padding: 16px 20px;
  border-bottom: 1px solid #00ff88;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.header-text {
  text-align: left;
}

.header-title {
  font-size: 24px;
  font-weight: bold;
  color: #00ff88;
  margin-bottom: 4px;
}

.header-subtitle {
  color: #999;
  font-size: 14px;
}

.credits {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid #00ff88;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #00ff88;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.profile-btn:hover {
  opacity: 1;
}

.settings-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.settings-btn:hover {
  opacity: 1;
}

.settings-btn#connectWalletBtn {
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: bold;
  font-size: 14px;
}

.settings-btn#connectWalletBtn.connected {
  background: #1e90ff;
  border-color: #1e90ff;
  color: white;
}

.credits-plus {
  background: #00ff88;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Character Browser */
.character-browser {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.section {
  padding: 20px;
  overflow: hidden;
}

.section-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
  color: #fff;
}

.character-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 4px 4px 4px;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.character-grid::-webkit-scrollbar {
  display: none;
}

.character-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 170px;
  height: 240px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 4px 0;
}

.character-card:hover {
  border-color: #00ff88;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
  transform: scale(1.02);
}

.character-avatar {
  width: 100%;
  height: 130px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 8px;
  flex-shrink: 0;
  background-color: #222;
}

.character-name {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-creator {
  font-size: 11px;
  color: #666;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-interactions {
  font-size: 10px;
  color: #00ff88;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-description {
  font-size: 10px;
  color: #999;
  line-height: 1.3;
  overflow: hidden;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  /* Modern (standard) property */
  line-clamp: 2;

  /* Add other vendor prefixes for safety */
  display: -moz-box; /* (Optional - for older Firefox) */
  display: -ms-box; /* (Optional - for older IE) */

  flex: 1;
  margin-top: auto;
}

.character-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.plus-card {
  border: 2px dashed #333;
  background: rgba(0, 255, 136, 0.05);
}

.plus-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  font-size: 40px;
  height: 130px;
  border-radius: 8px;
}

.placeholder-card {
  border: 1px solid #222;
  background: rgba(40, 40, 40, 0.5);
  cursor: not-allowed;
  opacity: 0.6;
}

.placeholder-card:hover {
  border-color: #444;
  box-shadow: 0 2px 8px rgba(100, 100, 100, 0.2);
  transform: scale(1.01);
}

.placeholder-avatar {
  background: linear-gradient(135deg, #333 0%, #555 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 24px;
  height: 130px;
  border-radius: 8px;
}

.placeholder-text {
  color: #999 !important;
  font-weight: 500;
}

.coming-soon {
  background: rgba(0, 255, 136, 0.05);
  border: 1px dashed #555;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  margin-top: 4px;
}

/* Chat View */
#chatView {
  display: none;
  flex-direction: column;
  height: 100vh;
}

.chat-header {
  background: #000;
  padding: 16px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  background: none;
  border: none;
  color: #00ff88;
  font-size: 24px;
  cursor: pointer;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.chat-info {
  flex: 1;
  overflow: hidden;
}

.chat-character-name {
  font-weight: bold;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.chat-character-creator {
  font-size: 12px;
  color: #666;
}

.gift-btn {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #ffd700;
  color: #ffd700;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.history-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.history-btn:hover {
  opacity: 1;
}

.refer-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.refer-btn:hover {
  opacity: 1;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.welcome-message h3 {
  color: #00ff88;
  margin-bottom: 8px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.4;
}

.message.user .message-bubble {
  background: #00ff88;
  color: #000;
  border-bottom-right-radius: 4px;
}

.message.character .message-bubble {
  background: #222;
  color: #fff;
  border-bottom-left-radius: 4px;
}

.message.gift-sent {
  justify-content: center;
}

.message.gift-sent .message-bubble {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #000;
  font-weight: bold;
  text-align: center;
  padding: 12px 24px;
  border-radius: 20px;
}

.typing-indicator {
  display: none;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.typing-indicator.show {
  display: flex;
}

.typing-bubble {
  padding: 12px 16px;
  background: #222;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  margin: 0 1px;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Input Area */
.chat-input-container {
  padding: 16px;
  border-top: 1px solid #333;
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
}

.send-button {
  background: #00ff88;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

/* Purchase Modal */
.purchase-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.purchase-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  height: 90%;
  overflow-y: auto;
}

.purchase-header {
  text-align: center;
  margin-bottom: 24px;
}

.purchase-header h2 {
  color: #00ff88;
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 600;
}

.purchase-header p {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 0;
}

.purchase-options {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.purchase-option {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.purchase-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1) 0%,
    rgba(0, 255, 136, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.purchase-option:hover::before {
  opacity: 1;
}

.purchase-option.best-value {
  border-color: #00ff88;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1) 0%,
    rgba(0, 255, 136, 0.05) 100%
  );
  position: relative;
}

.value-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00ff88 0%, #00cc70 100%);
  color: #000;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.5);
  z-index: 10;
  white-space: nowrap;
}

.purchase-option:hover {
  border-color: #00ff88;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 255, 136, 0.2);
  background: linear-gradient(135deg, #252525 0%, #303030 100%);
}

.purchase-option.selected {
  border-color: #00ff88;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.15) 0%,
    rgba(0, 255, 136, 0.1) 100%
  );
  box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
  transform: translateY(-1px);
}

.purchase-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  flex: 1;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.buy-now-btn {
  width: 100%;
  background: #00ff88;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer !important;
  transition: all 0.3s ease;
  margin-top: auto;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.buy-now-btn:hover {
  background: #00dd77;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.purchase-amount {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.energy-icon {
  color: #00ff88;
  font-size: 20px;
}

.purchase-price {
  font-size: 24px;
  font-weight: 700;
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.stripe-checkout-btn {
  width: 100%;
  min-height: 45px;
  background: #00ff88;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: 45px;
  position: relative;
  z-index: 100;
}

.stripe-checkout-btn:hover {
  background: #00dd77;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
  color: #0a0a0a;
}

.stripe-checkout-btn:active {
  transform: translateY(0);
}

.kaia-checkout-btn {
  width: 100%;
  min-height: 45px;
  background: #1e90ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: 45px;
  position: relative;
  z-index: 1;
}

.kaia-checkout-btn:hover {
  background: #1c86e4;
}

.purchase-notice {
  text-align: center;
  padding: 16px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 12px;
  margin-bottom: 20px;
}

.purchase-notice p {
  margin: 4px 0;
  font-size: 13px;
  color: #ccc;
}

.purchase-notice p:first-child {
  color: #00ff88;
  font-weight: 500;
}

/* Gift Modal */
.gift-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.gift-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.gift-item {
  background: #222;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.gift-item:hover {
  border-color: #ffd700;
}

.gift-emoji {
  font-size: 32px;
  margin-bottom: 4px;
}

.gift-cost {
  font-size: 12px;
  color: #00ff88;
}

.close-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #444;
  transform: translateY(-1px);
}

/* Character Creator Modal */
.character-creator-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.creator-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.creator-header {
  text-align: center;
  margin-bottom: 24px;
}

.creator-header h2 {
  color: #00ff88;
  margin-bottom: 8px;
}

.creator-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  color: #fff;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #00ff88;
}

.personality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.personality-btn {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.personality-btn:hover,
.personality-btn.active {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
}

.creator-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.create-btn {
  flex: 1;
  background: #00ff88;
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.create-btn:hover {
  background: #00dd77;
}

.cancel-btn {
  flex: 1;
  background: #333;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-btn:hover {
  background: #444;
}

/* Settings Modal - Removed, replaced with Profile Modal */

/* History Modal - Messenger Style */
.history-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.history-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 0;
  max-width: 420px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-header {
  background: #000;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-header h2 {
  font-size: 20px;
  margin: 0;
  color: #fff;
}

.history-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.history-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-right: 12px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.history-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.history-info-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.history-character {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
}

.history-date {
  font-size: 12px;
  color: #666;
  flex-shrink: 0;
  margin-left: 8px;
}

.history-preview {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.history-delete {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-item:hover .history-delete {
  opacity: 1;
}

.history-delete:hover {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.no-history {
  text-align: center;
  color: #666;
  padding: 60px 20px;
  font-size: 16px;
}

/* Scrollbar styling for history list */
.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Notification System */
.app-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 320px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 4000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-out;
}

.app-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.app-notification.success {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
}

.app-notification.error {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-icon {
  font-size: 24px;
}

.notification-message {
  flex: 1;
  color: #fff;
  font-size: 14px;
}

/* Purchase Success Modal */
.purchase-success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.purchase-success-content {
  background: #1a1a1a;
  border: 2px solid #00ff88;
  border-radius: 16px;
  padding: 32px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  animation: successPop 0.3s ease-out;
}

@keyframes successPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.purchase-success-content h3 {
  color: #00ff88;
  font-size: 24px;
  margin-bottom: 12px;
}

.purchase-success-content p {
  color: #ccc;
  margin-bottom: 8px;
}

.success-order-id {
  font-size: 12px;
  color: #666;
  margin-bottom: 20px;
}

.purchase-success-content button {
  background: #00ff88;
  color: #000;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.purchase-success-content button:hover {
  background: #00cc77;
}

/* Delete Confirmation Modal */
.delete-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.delete-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 32px;
  max-width: 320px;
  width: 90%;
  text-align: center;
}

.delete-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.delete-content h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #fff;
}

.delete-content p {
  color: #999;
  font-size: 14px;
  margin-bottom: 24px;
}

.delete-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.delete-cancel-btn,
.delete-confirm-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.delete-cancel-btn {
  background: #333;
  color: #fff;
}

.delete-cancel-btn:hover {
  background: #444;
}

.delete-confirm-btn {
  background: #ff4444;
  color: #fff;
}

.delete-confirm-btn:hover {
  background: #ff3333;
}

/* Referral Modal */
.referral-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.referral-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  position: relative;
}

.referral-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.referral-header h2 {
  color: #00ff88;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.referral-close-btn {
  position: absolute;
  top: 0;
  right: 10px;
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.3s;
}

.referral-close-btn:hover {
  color: #fff;
}

.referral-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.referral-description {
  text-align: center;
}

.referral-description p {
  color: #ccc;
  font-size: 16px;
  line-height: 1.5;
}

.referral-actions {
  display: flex;
  justify-content: center;
}

.share-referral-btn {
  background: linear-gradient(135deg, #00ff88, #00cc77);
  border: none;
  color: #000;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.share-referral-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 255, 136, 0.4);
}

.share-referral-btn:active {
  transform: translateY(0);
}

.share-referral-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.share-referral-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* Light Theme */
body.light-theme {
  background: #f5f5f5;
  color: #333;
}

body.light-theme .app-container {
  background: #fff;
}

body.light-theme .header {
  background: #fff;
  border-bottom-color: #00cc77;
}

body.light-theme .header-subtitle {
  color: #555;
  font-weight: 500;
}

body.light-theme .character-card {
  background: #f9f9f9;
  border-color: #e0e0e0;
}

body.light-theme .character-card:hover {
  border-color: #00cc77;
  box-shadow: 0 4px 12px rgba(0, 204, 119, 0.2);
}

body.light-theme .character-avatar {
  background-color: #e8e8e8;
}

body.light-theme .character-creator {
  color: #555;
  font-weight: 500;
}

body.light-theme .character-description {
  color: #444;
}

body.light-theme .plus-card {
  border-color: #ddd;
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .placeholder-card {
  border-color: #ddd;
  background: rgba(240, 240, 240, 0.8);
  opacity: 0.8;
}

body.light-theme .placeholder-avatar {
  background: linear-gradient(135deg, #ddd 0%, #eee 100%);
  color: #aaa;
}

body.light-theme .placeholder-text {
  color: #666 !important;
  font-weight: 500;
}

body.light-theme .section-title {
  color: #333;
}

body.light-theme .chat-header {
  background: #fff;
  border-bottom-color: #e0e0e0;
}

body.light-theme .chat-messages {
  background: #f9f9f9;
}

body.light-theme .message.character .message-bubble {
  background: #e8e8e8;
  color: #333;
}

body.light-theme .chat-input-container {
  background: #fff;
  border-top-color: #e0e0e0;
}

body.light-theme .chat-input {
  background: #f5f5f5;
  border-color: #ddd;
  color: #333;
}

body.light-theme .typing-bubble {
  background: #e8e8e8;
}

body.light-theme .welcome-message {
  color: #444;
  font-weight: 500;
}

body.light-theme .welcome-message h3 {
  color: #008844;
}

body.light-theme .purchase-modal,
body.light-theme .gift-modal,
body.light-theme .character-creator-modal,
body.light-theme .settings-modal,
body.light-theme .history-modal,
body.light-theme .referral-modal {
  background: rgba(0, 0, 0, 0.6);
}

body.light-theme .purchase-content,
body.light-theme .gift-content,
body.light-theme .creator-content,
body.light-theme .settings-content,
body.light-theme .history-content,
body.light-theme .referral-content {
  background: #fff;
  border-color: #e0e0e0;
}

body.light-theme .purchase-option {
  background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
  border-color: #e0e0e0;
}

body.light-theme .purchase-option::before {
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(0, 204, 119, 0.1) 100%
  );
}

body.light-theme .purchase-option.popular {
  border-color: #00cc77;
  background: linear-gradient(
    135deg,
    rgba(0, 204, 119, 0.05) 0%,
    rgba(0, 204, 119, 0.1) 100%
  );
}

body.light-theme .purchase-option:hover {
  border-color: #00cc77;
  box-shadow: 0 8px 24px rgba(0, 204, 119, 0.2);
}

body.light-theme .purchase-option.selected {
  border-color: #00cc77;
  background: linear-gradient(
    135deg,
    rgba(0, 204, 119, 0.15) 0%,
    rgba(0, 204, 119, 0.1) 100%
  );
  box-shadow: 0 8px 24px rgba(0, 204, 119, 0.3);
  transform: translateY(-1px);
}

body.light-theme .purchase-amount {
  color: #222;
  font-weight: 600;
}

body.light-theme .energy-icon {
  color: #008844;
}

body.light-theme .purchase-price {
  color: #006633;
  text-shadow: none;
  font-weight: 800;
}

body.light-theme .gift-item,
body.light-theme .form-group input,
body.light-theme .form-group textarea,
body.light-theme .personality-btn,
body.light-theme .theme-btn,
body.light-theme .language-btn {
  background: #f5f5f5;
  border-color: #ddd;
  color: #333;
}

body.light-theme .personality-btn:hover,
body.light-theme .personality-btn.active,
body.light-theme .theme-btn:hover,
body.light-theme .language-btn:hover {
  border-color: #00cc77;
}

body.light-theme .theme-btn.active,
body.light-theme .language-btn.active {
  background: rgba(0, 204, 119, 0.1);
  border-color: #00cc77;
  color: #00cc77;
}

body.light-theme .history-header {
  background: #f9f9f9;
  border-bottom-color: #e0e0e0;
}

body.light-theme .history-header h2 {
  color: #333;
}

body.light-theme .history-close-btn {
  color: #666;
}

body.light-theme .history-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

body.light-theme .history-item {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .referral-header h2 {
  color: #008844;
}

body.light-theme .referral-close-btn {
  color: #666;
}

body.light-theme .referral-close-btn:hover {
  color: #333;
}

body.light-theme .referral-description p {
  color: #555;
}

body.light-theme .history-item:hover {
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .history-character {
  color: #333;
}

body.light-theme .history-date {
  color: #999;
}

body.light-theme .history-preview {
  color: #666;
}

body.light-theme .history-delete {
  color: #999;
}

body.light-theme .history-delete:hover {
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
}

body.light-theme .no-history {
  color: #999;
}

body.light-theme .history-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

body.light-theme .history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

body.light-theme .history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.light-theme .delete-modal {
  background: rgba(0, 0, 0, 0.7);
}

body.light-theme .delete-content {
  background: #fff;
  border-color: #e0e0e0;
}

body.light-theme .delete-content h3 {
  color: #333;
}

body.light-theme .delete-content p {
  color: #666;
}

body.light-theme .delete-cancel-btn {
  background: #f0f0f0;
  color: #333;
}

body.light-theme .delete-cancel-btn:hover {
  background: #e0e0e0;
}

body.light-theme .purchase-success-modal {
  background: rgba(0, 0, 0, 0.7);
}

body.light-theme .purchase-success-content {
  background: #fff;
  border-color: #00cc77;
}

body.light-theme .purchase-success-content h3 {
  color: #00cc77;
}

body.light-theme .purchase-success-content p {
  color: #333;
}

body.light-theme .success-order-id {
  color: #999;
}

body.light-theme .app-notification {
  background: #f9f9f9;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-theme .app-notification.success {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.1);
}

body.light-theme .app-notification.error {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

body.light-theme .notification-message {
  color: #333;
}

body.light-theme .form-group label,
body.light-theme .setting-item label {
  color: #222;
  font-weight: 600;
}

body.light-theme .close-btn {
  background: #e0e0e0;
  color: #333;
}

body.light-theme .cancel-btn {
  background: #e0e0e0;
  color: #333;
}

body.light-theme .cancel-btn:hover {
  background: #d0d0d0;
}

body.light-theme .purchase-price {
  color: #666;
}

body.light-theme .chat-character-creator {
  color: #555;
  font-weight: 500;
}

body.light-theme .credits {
  background: rgba(0, 136, 68, 0.15);
  border-color: #008844;
  color: #006633;
  font-weight: 600;
}

body.light-theme .credits #creditsCount,
body.light-theme .credits #chatCreditsCount {
  color: #005522 !important;
  font-weight: 700;
}

body:not(.light-theme) .credits #creditsCount,
body:not(.light-theme) .credits #chatCreditsCount {
  color: #00ff88 !important;
  font-weight: 700;
}

body.light-theme .credits-plus {
  background: #008844;
  color: #fff;
}

body.light-theme .header-title {
  color: #00cc77;
}

body.light-theme .character-interactions {
  color: #00cc77;
}

body.light-theme .gift-cost {
  color: #00cc77;
}

body.light-theme .purchase-amount {
  color: #00cc77;
}

body.light-theme .purchase-header h2,
body.light-theme .creator-header h2,
body.light-theme .settings-header h2 {
  color: #008844;
  font-weight: 700;
}

body.light-theme .purchase-header p,
body.light-theme .creator-header p,
body.light-theme .settings-header p {
  color: #555;
  font-weight: 500;
}

body.light-theme .purchase-notice {
  background: rgba(0, 136, 68, 0.1);
  border-color: #008844;
  color: #444;
}

body.light-theme .purchase-notice p {
  color: #444;
  font-weight: 500;
}

body.light-theme .create-btn {
  background: #00cc77;
}

body.light-theme .create-btn:hover {
  background: #00bb66;
}

body.light-theme .profile-btn {
  opacity: 0.9;
}

body.light-theme .profile-btn:hover {
  opacity: 1;
}

body.light-theme .settings-btn#connectWalletBtn {
  background: #e0e0e0;
  color: #333;
  border-color: #ccc;
}

body.light-theme .kaia-checkout-btn:hover {
  background: #1c86e4;
}

body.light-theme .back-btn {
  color: #00cc77;
}

body.light-theme .send-button {
  background: #00cc77;
}

body.light-theme .stripe-checkout-btn {
  background: #008844;
  color: #fff;
  font-weight: 600;
}

body.light-theme .stripe-checkout-btn:hover {
  background: #006633;
  box-shadow: 0 4px 12px rgba(0, 136, 68, 0.3);
}

body.light-theme .message.user .message-bubble {
  background: #00cc77;
}

body.light-theme .typing-indicator span {
  background: #00cc77;
}

body.light-theme .plus-avatar {
  background: rgba(0, 204, 119, 0.1);
  color: #00cc77;
}

body.light-theme .coming-soon {
  background: rgba(0, 204, 119, 0.05);
  border-color: #ccc;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .character-card {
    width: 150px;
    height: 220px;
  }

  .character-avatar {
    height: 110px;
  }

  .plus-avatar {
    height: 110px;
    font-size: 36px;
  }

  .character-name {
    font-size: 12px;
  }

  .character-creator,
  .character-interactions,
  .character-description {
    font-size: 9px;
  }
}

@media (max-width: 320px) {
  .character-card {
    width: 130px;
    height: 200px;
  }

  .character-avatar {
    height: 95px;
  }

  .plus-avatar {
    height: 95px;
    font-size: 32px;
  }
}

/* Mobile optimization for chat interface */
@media (max-width: 428px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }

  .app-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Chat input container fixes */
  .chat-input-container {
    padding: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: inherit;
    border-top: 1px solid #333;
    z-index: 100;
  }

  .chat-input-wrapper {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 100%;
  }

  .chat-input {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
  }

  .send-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 22px;
    font-size: 18px;
    flex-shrink: 0;
  }

  /* Chat messages container */
  .chat-messages {
    padding-bottom: 80px; /* Space for fixed input */
    overflow-x: hidden;
  }

  .message {
    margin: 8px 12px;
    max-width: calc(100% - 24px);
  }

  .message-bubble {
    max-width: 85%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

.payment-method {
  margin-bottom: 20px;
}

.payment-method h3 {
  color: #00ff88;
  margin-bottom: 12px;
  font-size: 16px;
}

.payment-options {
  display: flex;
  gap: 16px;
}

.payment-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.payment-options label:hover {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.05);
}

.payment-options input[type="radio"]:checked + span {
  color: #00ff88;
  font-weight: 600;
}

.payment-options input[type="radio"] {
  margin: 0;
}

.purchase-agreements {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.purchase-agreements label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #aaa;
  cursor: pointer;
  line-height: 1.4;
}

.purchase-agreements input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.purchase-actions {
  margin-bottom: 20px;
}

.confirm-purchase-btn {
  width: 100%;
  min-height: 45px;
  background: #00ff88;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirm-purchase-btn:hover {
  background: #00dd77;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
  color: #0a0a0a;
}

.confirm-purchase-btn:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Purchase Summary Modal */
.purchase-summary-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.purchase-summary-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  position: relative;
}

.purchase-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.purchase-summary-header h2 {
  color: #00ff88;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.purchase-summary-body {
  margin-bottom: 20px;
}

.purchase-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.summary-label {
  color: #ccc;
  font-size: 14px;
}

.summary-value {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.energy-package-display {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid #00ff88;
  border-radius: 12px;
  padding: 20px;
  margin: 12px 0;
}

.energy-package-content {
  text-align: center;
}

.energy-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.energy-price {
  font-size: 20px;
  font-weight: 700;
  color: #00ff88;
  text-align: center;
}

.payment-method-section {
  margin-bottom: 20px;
}

.loading-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
  color: #1e90ff;
  font-size: 16px;
}

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

.payment-method-options {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.payment-option-btn {
  flex: 1;
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
}

.payment-option-btn:hover {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.05);
}

.payment-option-btn.active {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
}

.view-details {
  color: #00ff88;
  text-decoration: none;
  font-size: 12px;
}

.view-details:hover {
  text-decoration: underline;
}

/* Light theme payment options */
body.light-theme .payment-options label {
  border-color: #ddd;
  color: #333;
}

body.light-theme .payment-options label:hover {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .payment-options input[type="radio"]:checked + span {
  color: #00cc77;
  font-weight: 600;
}

/* Light theme for new elements */
body.light-theme .buy-now-btn {
  background: #00cc77;
  color: #fff;
}

body.light-theme .buy-now-btn:hover {
  background: #00bb66;
  box-shadow: 0 4px 12px rgba(0, 204, 119, 0.3);
}

body.light-theme .purchase-summary-content {
  background: #fff;
  border-color: #e0e0e0;
}

body.light-theme .purchase-summary-header h2 {
  color: #00cc77;
}

body.light-theme .purchase-summary-body {
  background: rgba(0, 204, 119, 0.1);
  border-color: rgba(0, 204, 119, 0.2);
}

body.light-theme .summary-label {
  color: #555;
}

body.light-theme .summary-value {
  color: #333;
}

body.light-theme .view-details {
  color: #00cc77;
}

body.light-theme .purchase-agreements label {
  color: #555;
}

/* Light theme for new purchase summary elements */
body.light-theme .purchase-summary-content {
  background: #fff;
  border-color: #e0e0e0;
}

body.light-theme .purchase-summary-header h2 {
  color: #00cc77;
}

body.light-theme .modal-close-btn {
  color: #666;
}

body.light-theme .modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

body.light-theme .energy-package-display {
  background: rgba(0, 204, 119, 0.1);
  border-color: #00cc77;
}

body.light-theme .energy-amount {
  color: #333;
}

body.light-theme .energy-price {
  color: #00cc77;
}

body.light-theme .payment-option-btn {
  background: #f5f5f5;
  border-color: #ddd;
  color: #666;
}

body.light-theme .payment-option-btn:hover {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .payment-option-btn.active {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.1);
  color: #00cc77;
}

body.light-theme .summary-label {
  color: #555;
}

body.light-theme .summary-value {
  color: #333;
}

/* Profile Modal */
.profile-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.profile-content {
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-header {
  background: #000;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-header h2 {
  font-size: 20px;
  margin: 0;
  color: #00ff88;
  font-weight: 600;
}

.profile-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 28px; /* Slightly larger for better visibility */
  cursor: pointer;
  padding: 0; /* Add padding for better click area */
  width: 40px; /* Increase size */
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;

  /* Prevent compression and overflow */
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;

  /* Hover effects for better UX */
  opacity: 0.7;
}
.profile-close-btn:hover {
  color: #fff;
}

.profile-close-btn:active {
  transform: scale(0.95);
}

.profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  border: 2px solid #00ff88;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-info {
  text-align: center;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 14px;
  color: #666;
}

.profile-section {
  margin-bottom: 24px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-row.clickable {
  cursor: pointer;
  transition: all 0.3s;
}

.profile-row.clickable:hover {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px 8px;
  margin: 0 -8px;
}

.profile-label {
  font-size: 14px;
  color: #ccc;
  font-weight: 500;
}

.profile-value-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-value {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.profile-chevron {
  font-size: 16px;
  color: #666;
  margin-left: 8px;
}

.profile-copy-icon {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.profile-row.clickable:hover .profile-copy-icon {
  opacity: 1;
}

.purchase-header {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}

.purchase-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: #999;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  opacity: 0.7;
}

.purchase-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #666;
  opacity: 1;
  transform: scale(1.1);
}

.purchase-close-btn:active {
  transform: scale(0.95);
}

.connect-wallet-btn {
  width: 100%;
  min-width: 280px;
  max-width: none;
  height: 52px;
  background: #06c755;
  color: #ffffff;
  border: none;
  border-radius: 13px; /* 52px * 0.25 = 13px */
  padding: 0 16px;
  font-size: 18px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8.4px; /* 13px * 0.35 = 4.55px, but using 8.4px for better visual spacing */
  margin: 12px auto 0;
  text-align: center;
  position: relative;
}

/* Ensure button is centered in its container */
.profile-section .connect-wallet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive design for smaller screens */
@media (max-width: 375px) {
  .connect-wallet-btn {
    min-width: 280px;
    height: 52px;
    font-size: 18px;
  }

  .connect-symbol {
    width: 24px;
    height: 24px;
  }
}

/* Ensure proper spacing and alignment */
.connect-wallet-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.connect-wallet-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.connect-wallet-btn:hover {
  background: #05b54a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}

.connect-wallet-btn.connected {
  background: #1e90ff;
  color: #ffffff;
}

.connect-wallet-btn.connected:hover {
  background: #1c86e4;
}

.connect-symbol {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: brightness(0) invert(1); /* Makes the SVG white */
}

.connect-text {
  color: #ffffff;
  font-weight: 500;
}

.profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 24px 0;
}

.profile-options {
  display: flex;
  gap: 8px;
}

.profile-option-btn {
  flex: 1;
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.profile-option-btn:hover {
  /* border-color: #00ff88; */
  background: rgba(0, 255, 136, 0.05);
}

.profile-option-btn.active {
  background: #00ff88;
  border-color: #00ff88;
  color: #000;
  font-weight: 600;
}

.option-icon {
  font-size: 14px;
}

/* Light theme for profile modal */
body.light-theme .profile-modal {
  background: rgba(0, 0, 0, 0.6);
}

body.light-theme .profile-content {
  background: #fff;
  border-color: #e0e0e0;
}

body.light-theme .profile-header {
  background: #f9f9f9;
  border-bottom-color: #e0e0e0;
}

body.light-theme .profile-header h2 {
  color: #00cc77;
}

body.light-theme .profile-close-btn {
  color: #666;
}

body.light-theme .profile-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

body.light-theme .profile-avatar {
  background: #f0f0f0;
  border-color: #00cc77;
}

body.light-theme .profile-name {
  color: #333;
}

body.light-theme .profile-username {
  color: #666;
}

body.light-theme .profile-row {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .profile-row.clickable:hover {
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .profile-label {
  color: #555;
}

body.light-theme .profile-value {
  color: #333;
}

body.light-theme .profile-chevron {
  color: #999;
}

body.light-theme .profile-copy-icon {
  color: #999;
}

body.light-theme .connect-wallet-btn {
  background: #06c755;
  color: #ffffff;
}

body.light-theme .connect-wallet-btn:hover {
  background: #05b54a;
}

body.light-theme .connect-wallet-btn.connected {
  background: #1e90ff;
  color: #ffffff;
}

body.light-theme .profile-divider {
  background: rgba(0, 0, 0, 0.1);
}

body.light-theme .profile-option-btn {
  background: #f5f5f5;
  border-color: #ddd;
  color: #666;
}

body.light-theme .profile-option-btn:hover {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.05);
}

body.light-theme .profile-option-btn.active {
  border-color: #00cc77;
  background: rgba(0, 204, 119, 0.1);
  color: #00cc77;
}
