/* =========================================
   Mindfolk Staking Preview Styles
   -----------------------------------------
   Isolated styling for the prototype UI so
   the production site remains untouched.
========================================= */

:root {
  --staking-bg: #0f1729;
  --staking-card-bg: rgba(20, 27, 43, 0.9);
  --staking-border: rgba(255, 255, 255, 0.08);
  --staking-glow: rgba(255, 193, 7, 0.35);
  --staking-text-muted: #9ca6bf;
}

.staking-section {
  background: linear-gradient(135deg, #f7a823 0%, #f15c0d 100%);
  position: relative;
  overflow: hidden;
  color: #fff;
  margin-bottom: 0;
}

.staking-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.15), transparent 45%),
              radial-gradient(circle at bottom right, rgba(17, 17, 17, 0.15), transparent 55%);
  pointer-events: none;
  opacity: 0.4;
}

.staking-section .container {
  position: relative;
  z-index: 1;
}

.staking-section .staking-preview-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.staking-section .text-muted {
  color: rgba(255, 255, 255, 0.75) !important;
}

.staking-section .staking-title {
  color: #fff;
}

.staking-section .staking-card {
  box-shadow: 0 20px 45px rgba(17, 17, 17, 0.35);
}

.staking-heading {
  font-family: 'dirty_brushregular', cursive;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: 0.06em;
}

.staking-title {
  font-family: 'dirty_brushregular', cursive;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.staking-card {
  background: linear-gradient(135deg, rgba(17, 25, 40, 0.95), rgba(10, 14, 26, 0.9));
  border: 1px solid var(--staking-border);
  padding: clamp(1.35rem, 1.8vw, 2rem);
  position: relative;
  overflow: hidden;
}

.staking-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left, rgba(255, 193, 7, 0.12), transparent 65%);
  opacity: 0.8;
  pointer-events: none;
  transform: rotate(8deg);
}

.staking-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  pointer-events: none;
}

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

[data-connect-wallet].shake {
  animation: staking-shake 0.6s ease;
}

.staking-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(17, 24, 39, 0.8);
  border-radius: 999px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--staking-border);
}

.staking-toggle-btn {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--staking-text-muted);
  font-weight: 600;
  letter-spacing: 0.015em;
  padding: 0.55rem 0.75rem;
  transition: all 0.25s ease;
}

.staking-toggle-btn:hover,
.staking-toggle-btn:focus-visible {
  color: #ffc107;
  outline: none;
}

.staking-toggle-btn.active {
  background: linear-gradient(135deg, #ffc107, #ff9f0d);
  color: #111;
  box-shadow: 0 8px 18px -10px var(--staking-glow);
}

.staking-toggle-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.staking-toggle-btn-disabled:hover,
.staking-toggle-btn-disabled:focus-visible {
  color: var(--staking-text-muted) !important;
}

.staking-panel {
  display: none;
  animation: fadeUp 300ms ease forwards;
}

.staking-panel.active {
  display: block;
}

.staking-panel-header h2 {
  font-weight: 700;
}

.staking-panel-header p {
  color: var(--staking-text-muted);
}

.staking-form .input-group-text {
  font-weight: 600;
}

.staking-form .form-control {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  padding-left: 0;
  padding-right: 0;
}

.staking-form .form-control.staking-amount-input {
  border: none;
  border-radius: 18px 0 0 18px;
  padding-right: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #ffc107;
}

.staking-amount-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.staking-amount-input:focus {
  color: #ffe082;
  background: transparent;
}

.staking-amount-input-group {
  border: 1px solid rgba(255, 193, 7, 0.45);
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.65);
  box-shadow: 0 12px 30px -18px rgba(17, 17, 17, 0.65);
  padding: 0.35rem 0.95rem 0.35rem 1rem;
  gap: 0.5rem;
}

.staking-amount-input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.18);
}

.staking-amount-input-group .input-group-text {
  border: none;
  color: #ffc107;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  background: transparent;
  padding-right: 0;
}

[data-usd-conversion] {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

[data-wallet-selector] {
  margin-bottom: 1rem;
}

[data-wallet-selector] .form-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 500;
}

[data-wallet-selector] .form-select {
  background-color: rgba(17, 24, 39, 0.85) !important;
  border: 1px solid rgba(255, 193, 7, 0.3) !important;
  color: #fff !important;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  transition: all 0.2s ease;
}

[data-wallet-selector] .form-select:focus {
  border-color: rgba(255, 193, 7, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15) !important;
  background-color: rgba(17, 24, 39, 0.95) !important;
}

[data-wallet-selector] .form-select option {
  background-color: #1a1f2e;
  color: #fff;
}

[data-wallet-selector] .form-select option:disabled {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* Wallet Modal Styles */
.wallet-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.wallet-modal.wallet-modal-show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.wallet-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wallet-modal-backdrop.wallet-modal-backdrop-show {
  opacity: 1;
  visibility: visible;
}

.wallet-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  z-index: 9999;
  transform: scale(0.95) translateY(-20px);
  transition: transform 0.3s ease;
}

.wallet-modal.wallet-modal-show .wallet-modal-dialog {
  transform: scale(1) translateY(0);
}

.wallet-modal-content {
  background: linear-gradient(135deg, rgba(17, 25, 40, 0.98), rgba(10, 14, 26, 0.98));
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.wallet-modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 193, 7, 0.1), transparent 60%);
  pointer-events: none;
}

.wallet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.wallet-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}

.wallet-modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

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

.wallet-modal-body {
  padding: 1.5rem 1.75rem;
  position: relative;
  z-index: 1;
}

.wallet-modal-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.wallet-grid {
  display: grid;
  gap: 0.75rem;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  position: relative;
}

.wallet-option:hover:not(.wallet-option-disabled) {
  background: rgba(17, 24, 39, 0.9);
  border-color: rgba(255, 193, 7, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wallet-option:active:not(.wallet-option-disabled) {
  transform: translateY(0);
}

.wallet-option-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(17, 24, 39, 0.4);
}

.wallet-option-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.wallet-option-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  padding: 4px;
  background: transparent;
}

.wallet-option-icon-fallback {
  position: absolute;
  inset: 0;
}

.wallet-option-icon i {
  font-size: 1.5rem;
}

.wallet-option-content {
  flex: 1;
  min-width: 0;
}

.wallet-option-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.wallet-option-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.wallet-option-arrow {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.wallet-option:hover:not(.wallet-option-disabled) .wallet-option-arrow {
  color: #ffc107;
  transform: translateX(4px);
}

@media (max-width: 576px) {
  .wallet-modal-dialog {
    max-width: calc(100% - 2rem);
    margin: 1rem;
  }
  
  .wallet-modal-header {
    padding: 1.25rem 1.5rem;
  }
  
  .wallet-modal-body {
    padding: 1.25rem 1.5rem;
  }
  
  .wallet-modal-title {
    font-size: 1.25rem;
  }
  
  .wallet-option {
    padding: 0.875rem 1rem;
  }
  
  .wallet-option-icon {
    width: 44px;
    height: 44px;
  }
}

/* Wallet Indicator in Navbar */
.wallet-indicator {
  padding: 0.4rem 0.75rem;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.wallet-indicator:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wallet-indicator-info {
  min-width: 0;
}

.wallet-indicator-name {
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-indicator-balance {
  color: #ffc107;
  font-weight: 600;
  white-space: nowrap;
}

.navbar-scrolled .wallet-indicator {
  background: #000;
  border-color: rgba(255, 255, 255, 0.2);
}

.navbar-scrolled .wallet-indicator-name {
  color: #fff;
}

.navbar-scrolled .wallet-indicator-balance {
  color: #ffc107;
}

/* Stake SOL Button - Bigger and Bolder Text */
[data-submit-stake] {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Success Modal Styles */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.success-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.success-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.success-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.success-modal-content {
  background: linear-gradient(135deg, rgba(17, 25, 40, 0.98), rgba(10, 14, 26, 0.98));
  border: 2px solid #ffc107;
  border-radius: 24px;
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 193, 7, 0.3);
  position: relative;
  z-index: 10001;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.3s ease;
  animation: successPulse 0.6s ease forwards;
}

.success-modal.show .success-modal-content {
  transform: scale(1) translateY(0);
}

.success-modal-icon {
  font-size: 5rem;
  color: #ffc107;
  margin-bottom: 1rem;
  animation: successBounce 0.6s ease;
}

.success-modal-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffc107;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.success-modal-message {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  padding: 0 0.5rem;
  text-align: center;
}

.success-modal-message div {
  margin-bottom: 0.75rem;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 0.9rem;
}

.success-modal-message div:last-child {
  margin-bottom: 0;
}

.success-modal-message a {
  color: #ffc107;
  text-decoration: underline;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
  font-size: 0.85rem;
}

@keyframes successPulse {
  0% {
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) translateY(0);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes successBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@media (max-width: 991px) {
  .wallet-indicator {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .success-modal-content {
    padding: 2rem 1.5rem;
    max-width: 90%;
  }
  
  .success-modal-icon {
    font-size: 4rem;
  }
  
  .success-modal-title {
    font-size: 1.5rem;
  }
  
  .success-modal-message {
    font-size: 1rem;
  }
}

.staking-amount-input {
  -moz-appearance: textfield;
}

.staking-amount-input::-webkit-outer-spin-button,
.staking-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.staking-balance-row {
  display: flex;
  align-items: center;
  justify-content: flex-end !important;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.staking-balance-row .staking-balance {
  flex: 0 0 auto;
  margin: 0;
}

.staking-balance-row .quick-amounts {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.staking-balance-row .quick-amounts .btn {
  border-color: rgba(255, 193, 7, 0.65);
}

.staking-form .form-control:focus {
  border-color: #ffc107;
  box-shadow: none;
}

.staking-summary {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}

.staking-summary strong {
  letter-spacing: 0.03em;
}

.staking-summary .text-warning {
  color: #ffc107 !important;
}

.staking-stats {
  background: rgba(17, 24, 39, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.staking-stats .text-muted {
  color: var(--staking-text-muted) !important;
}

.staking-stats span[data-staking-apy],
.staking-stats span[data-staking-commission] {
  letter-spacing: 0.06em;
}

.quick-amounts .btn {
  border-radius: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.validator-address {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #ffc107;
  word-break: break-all;
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.35rem;
}

.staking-note {
  color: var(--staking-text-muted);
}

.staking-feedback {
  min-height: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.staking-feedback--info {
  color: rgba(255, 255, 255, 0.75);
}

.staking-feedback--success {
  color: #9ef8d6;
}

.staking-feedback--error {
  color: #ffd1d1;
}

.staking-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 193, 7, 0.12);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.staking-preview-badge i {
  font-size: 0.95em;
}

.validator-callout {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  color: #ffc107;
  font-weight: 500;
}

.validator-callout .validator-description {
  color: #ffc107;
}

.staking-faq {
  background: rgba(10, 13, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: clamp(1.35rem, 2vw, 2rem);
}

.staking-faq h3 {
  font-family: 'dirty_brushregular', cursive;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  color: #ffc107;
  letter-spacing: 0.05em;
}

.staking-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.staking-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.staking-steps li span.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 193, 7, 0.18);
  color: #ffc107;
  font-size: 0.95rem;
  font-weight: 700;
}

.staking-steps li p {
  margin: 0;
  color: var(--staking-text-muted);
  font-size: 0.92rem;
}

.staking-legal {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 1.5rem;
}

@media (max-width: 992px) {
  .staking-card {
    margin-top: 2rem;
  }
}

@media (max-width: 576px) {
  .staking-card {
    padding: 1.5rem;
  }

  .staking-toggle {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .staking-toggle-btn {
    width: 100%;
  }
}

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

@keyframes staking-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

