@font-face {
  font-family: "CustomFont";
  src: url("MarkPro.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "CustomFontBold";
  src: url("MarkProBold.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "CustomFontMedium";
  src: url("MarkProMedium.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  /* Font Families */
  --font-primary: "CustomFont", Arial, sans-serif;
  --font-primary-bold: "CustomFontBold", Arial, sans-serif;
  --font-primary-medium: "CustomFontMedium", Arial, sans-serif;

  /* Font Sizes */
  --font-size-big-bold: 90px;
  --font-size-big-bold-2: 72px;
  --font-size-big-bold-3: 64px;
  --font-size-big-regular: 80px;
  --font-size-big-regular-2: 72px;

  --font-size-mid-bold: 40px;
  --font-size-mid-bold-2: 56px;
  --font-size-mid-medium: 40px;
  --font-size-mid-medium-2: 56px;
  --font-size-mid-medium-3: 32px;
  --font-size-mid-regular: 40px;
  --font-size-mid-regular-2: 32px;

  --font-size-small-bold: 24px;
  --font-size-small-bold-2: 20px;
  --font-size-small-medium: 24px;
  --font-size-small-regular: 24px;
  --font-size-small-regular-2: 20px;

  --font-size-xsmall-bold: 18px;
  --font-size-xsmall-bold-2: 16px;
  --font-size-xsmall: 18px;
  --font-size-xsmall-2: 12px;

  --font-size-xxsmall: 10px;

  /* Colors */
  --text-color-primary: #ec298f;
  --text-color-primary-light: #ffebf6;
  --text-color-light: #f6f7ff;
  --text-color-dark: #282a3d;
  --text-color-dark-mid-2: #4d5176;
  --text-color-dark-mid: #5e617d;
  --text-color-dark-mid-3: #8b8fc0;
}

body,
body * {
  font-family: var(--font-primary);
}

/* ===========================================
   POPUP MAIN STYLES
   =========================================== */
.popup {
  min-height: 80vh;
  position: absolute;
  top: 100px;
  right: 20px;
  /* padding: 20px; */
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 350px;
  height: 600px;
  font-family: var(--font-primary);
  margin: 0;
  background-color: white;
  color: #333;
  text-align: center;
  z-index: 100;
  overflow: hidden; /* Default hidden, changed to visible for swap */
}

/* ===========================================
   HEADER STYLES
   =========================================== */
.header-container {
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--text-color-light);
  height: 50px;
  border-radius: 10px;
  margin-bottom: 20px;
}

#wallet-header {
  color: var(--text-color-dark);
  font-family: var(--font-primary);
  font-size: var(--font-size-xsmall);
  margin-left: 60px;
}

#back-btn {
  position: absolute;
  left: 10px;
  background: transparent !important;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-color-dark);
}

#exit-wallet {
  position: absolute;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-primary-bold);
  cursor: pointer;
  font-size: var(--font-size-xsmall-bold);
  color: var(--text-color-dark-mid-2);
}
.all-wallet {
  border: none;
}
.button-text {
  margin-right: 10px;
}

.exit-icon {
  color: var(--text-color-dark-mid-2);
}

/* ===========================================
   ACCOUNT & BALANCE STYLES
   =========================================== */
#account {
  width: 90%;
  height: 50px;
  font-size: 10px;
  background-image: url("account-bg.png");
  background-size: contain;
  background-repeat: no-repeat;
  align-items: center;
  justify-content: center;
  position: relative;
  display: inline-flex;
  font-family: var(--font-primary);
  color: var(--text-color-dark-mid-2);
  font-size: var(--font-size-xsmall-bold-2);
  cursor: pointer;
}

#wallet-info {
  margin-top: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  display: inline-block;
  width: 90%;
  justify-content: center;
  align-items: center;
}

#wallet-info p {
  margin: 10px 0;
  font-size: 14px;
}

#wallet-info span {
  font-weight: bold;
  color: var(--text-color-dark-mid);
}

#balance-info {
  margin-top: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  width: 80%;
  justify-content: left;
  text-align: left;
  height: 220px;
}

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.token-name {
  font-weight: bold;
  text-align: left;
  min-width: 80px;
}

.token-amount {
  text-align: right;
  flex: 1;
  margin-left: 10px;
  margin-top: 15px;
}

/* ===========================================
   BUTTON STYLES
   =========================================== */
.button-container {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin: 20px 0;
}

.send-receive {
  width: 80px;
  height: 70px;
  color: var(--text-color-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
}

.send-receive span {
  font-weight: normal !important;
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--text-color-dark-mid-3) !important;
}

button {
  background-color: var(--text-color-light);
  color: var(--text-color-dark-mid-2) !important;
  font-family: var(--font-primary);
  border: none;
  padding: 10px 20px;
  margin: 10px 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

#import-wallet,
#create-wallet {
  margin-top: 10px;
  background-color: var(--text-color-primary);
  font-family: var(--font-primary-medium);
  color: white !important;
  width: 80%;
}

/* ===========================================
   TOGGLE STYLES
   =========================================== */
.toggle-container {
  position: relative;
  left: 10%;
  width: 75%;
  display: flex;
  gap: 10px;
  margin: 5px;
  margin-top: 25px;
  flex-direction: row;
}

.toggle-box-wallet {
  width: 100px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: var(--text-color-dark-mid);
  cursor: pointer;
  font-family: var(--font-primary-bold);
  font-size: var(--font-size-small-bold-2);
  transition: background 0.3s ease;
}

.toggle-box-wallet.active {
  color: var(--text-color-primary);
}

/* ===========================================
   NFT & ACTIVITY STYLES
   =========================================== */
#nfts {
  grid-template-columns: repeat(2, 1fr);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 8px;
}

.nft-item {
  flex: 0 0 calc(33.333% - 10px);
  max-width: 100px;
  aspect-ratio: 1;
}

.nft-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

#activities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.activity-item {
  flex: 0 0 calc(100% - 10px);
  max-width: calc(100% - 10px);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 10px;
  background: #f9f9f9;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  word-break: break-word;
}

.activity-item:hover {
  background: #f5f5f5;
  border-color: var(--text-color-primary);
  transform: translateY(-1px);
}

.activity-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
}

.activity-details {
  font-size: var(--font-size-xxsmall);
  color: var(--text-color-dark-mid-3);
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-primary);
}

.activity-details p {
  margin: 2px 0;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.activity-hash {
  font-family: monospace;
  font-size: var(--font-size-xxsmall);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: inline-block;
  vertical-align: top;
}

/* ===========================================
   MODAL STYLES
   =========================================== */
.terms-conditions {
  padding: 10px;
  font-family: var(--font-primary-medium);
  color: var(--text-color-dark-mid-2);
}

.import-mask,
.create-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 55;
}

.import-modal,
.create-modal {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 400px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-family: var(--font-primary-medium);
  z-index: 56;
}

.import-text,
.create-text {
  font-size: 14px;
  color: var(--text-color-dark-mid-2);
  margin-bottom: 10px;
  font-family: var(--font-primary-medium);
}

.import-grid,
.create-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.import-input {
  width: 90%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  font-family: var(--font-primary-medium);
}

.import-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-index {
  font-weight: bold;
  color: #555;
  width: 20px;
  text-align: right;
}

.create-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  font-weight: bold;
  font-size: 14px;
  color: var(--text-color-dark-mid-2);
}

.import-button,
.create-button {
  background-image: url("account-bg.png");
  color: var(--text-color-dark-mid-2);
  background-repeat: no-repeat;
  background-size: contain;
  width: 70%;
  height: 50px;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-small-medium);
  display: inline-flex;
  cursor: pointer;
  border: none;
  font-family: var(--font-primary-medium);
}

.create-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.create-checkbox-container a {
  color: var(--text-color-primary);
  text-decoration: none;
}

/* ===========================================
   SCREEN STYLES
   =========================================== */
#send-screen,
#receive-screen {
  display: none;
  background: white;
  padding: 20px;
}

#send-screen button {
  width: 50%;
  background: var(--text-color-primary);
  color: white !important;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Başlangıçta gizli */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-overlay.active {
    display: flex; /* Sadece .active class'ı eklendiğinde görünür */
}
#copy-address {
  width: 50%;
  background: var(--text-color-primary);
  color: white !important;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
}
#send-screen input,
#token-select {
  padding: 8px;
  margin: 10px 0;
}

.qr-container {
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
  margin-top: 20px;
}

.receive-screen {
  font-family: var(--font-primary);
}

.wallet-address {
  margin-top: 20px;
  font-size: var(--font-size-xsmall-2);
}

/* ===========================================
   SWAP SCREEN STYLES - FIXED
   =========================================== */
#swap-screen {
  display: none;
  position: relative;
  overflow: visible !important; /* Critical for dropdowns */
}

.card {
  --bs-card-border-color: none !important;
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1); */
  position: relative;
  overflow: visible; /* Allow dropdowns to overflow */
}

.trade-section-sell {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: -30px;
  position: relative;
}

.trade-section-buy {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  margin-top: -30px;
  position: relative;
}

.section-label {
  color: #9ca3af;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  text-align: left;
}

.amount-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.amount-input {
  display: flex;
  flex-direction: column;
}

.amount {
  font-size: 20px;
  font-weight: 300;
  color: #374151;
  margin-bottom: 4px;
  min-width: 80px;
  text-align: left;
  outline: none;
}

.amount[contenteditable="true"]:focus {
  outline: none;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 2px;
}

.subtext {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 300;
  text-align: left;
}

/* Token Selector Container - CRITICAL FIX */
.token-selector-container {
  position: relative;
  min-width: 160px;
  z-index: 10 !important;
}

.token-selector {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

.token-selector:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.token-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.pol-icon {
  background: linear-gradient(135deg, #8247e5, #744fe5);
}

.usdc-icon {
  background: linear-gradient(135deg, #2775ca, #2775ca);
}

.pawstar-icon {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.pawprint-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.token-name {
  color: #374151;
  font-size: 16px;
  font-weight: 500;
}

.dropdown-arrow,
.dropdown-arrows {
  color: #9ca3af;
  font-size: 16px;
  transition: transform 0.2s ease;
}

/* Dropdown Menu - FIXED POSITIONING */
.dropdown-menu,
#sell-dropdown-menu,
#dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  margin-top: 4px !important;
  z-index: 9999 !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  display: none;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.dropdown-menu.show,
#sell-dropdown-menu.show,
#dropdown-menu.show {
  display: block !important;
}

.token-option {
  padding: 12px 16px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  background: white;
}

.token-option:last-child {
  border-bottom: none;
}

.token-option:hover {
  background-color: #f8f9fa !important;
}

.token-option.selected {
  background-color: #e3f2fd !important;
  color: #007bff;
}

.option-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.option-name {
  font-weight: 500;
  font-size: 14px;
}

.option-symbol {
  color: #666;
  font-size: 12px;
  margin-left: auto;
}

/* Swap Arrow */
.swap-arrow {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  z-index: 3;
}

.swap-button {
  width: 48px;
  height: 48px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #9ca3af;
  font-size: 20px;
}

.swap-button:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px) rotate(180deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Start Button */
.start-button {
  width: 100%;
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white !important;
  border: none;
  border-radius: 20px;
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
  margin-top: 20px;
}

.start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.4);
}

/* Purchase Screen */
#purchase-screen-nft,
#purchase-screen-item {
  padding: 20px;
  text-align: center;
}

#purchase-screen-nft h3,
#purchase-screen-item h3 {
  margin-bottom: 15px;
  color: var(--text-color-dark);
  font-family: var(--font-primary-bold);
}

#confirm-purchase,
#confirm-item-purchase {
  background: var(--text-color-primary);
  color: white !important;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 15px;
}

/* Spinner */
#spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--text-color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  .popup {
    width: 300px;
    right: 10px;
  }

  .card {
    padding: 24px 16px;
    margin: 10px;
  }

  .amount {
    font-size: 18px;
  }

  .token-selector {
    padding: 10px 12px;
  }

  .token-icon {
    width: 28px;
    height: 28px;
  }

  .token-name {
    font-size: 14px;
  }
}

label[for="network-select"] {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

#network-select {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #8b8db5;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8db5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  margin-bottom: 24px;
  box-sizing: border-box;
}

#network-select:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#network-select:focus {
  border-color: #8b8db5;
  box-shadow: 0 0 0 3px rgba(139, 141, 181, 0.1);
}
label[for="token-select"] {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

#token-select {
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #8b8db5;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8db5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  margin-bottom: 24px;
  box-sizing: border-box;
}

#token-select:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#token-select:focus {
  border-color: #8b8db5;
  box-shadow: 0 0 0 3px rgba(139, 141, 181, 0.1);
}
label[for="recipient"],
label[for="amount"] {
  display: block;
  margin-bottom: 8px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

#recipient,
#amount {
  width: 100%;
  padding: 16px 20px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  color: #333;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  margin-bottom: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

#recipient::placeholder,
#amount::placeholder {
  color: #8b8db5;
  opacity: 1;
}

#recipient:hover,
#amount:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#recipient:focus,
#amount:focus {
  border-color: #8b8db5;
  box-shadow: 0 0 0 3px rgba(139, 141, 181, 0.1);
}

/* Specific styling for recipient address */
#recipient {
  font-family: "Courier New", monospace;
  font-size: 14px;
}
