/*
  Global styles for the Ledger Live wallet clone.
  The theme uses a dark background with purple accents and green highlights
  to evoke the look and feel of the Ledger Live desktop application.
*/

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  color: #ffffff;
}

/* Ledger-style background with gradients and crypto grid */
body {
  background: radial-gradient(1000px 600px at 10% -10%, rgba(122,92,255,.12), transparent 60%),
              radial-gradient(800px 500px at 90% 70%, rgba(80,55,255,.08), transparent 60%),
              #0b0f14;
  letter-spacing: .1px;
}

/* Crypto grid background - more visible */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(800px 500px at 85% 80%, rgba(80,55,255,.08), transparent 60%),
    radial-gradient(1000px 600px at 12% -10%, rgba(122,92,255,.12), transparent 60%),
    linear-gradient( to bottom right, rgba(255,255,255,.03), rgba(255,255,255,0) 40% ),
    linear-gradient( rgba(255,255,255,.06) 1px, transparent 1px ),
    linear-gradient( 90deg, rgba(255,255,255,.06) 1px, transparent 1px );
  background-size: auto, auto, auto, 50px 50px, 50px 50px;
  -webkit-mask: radial-gradient(ellipse at 15% 0%, rgba(0,0,0,.6), transparent 70%),
        radial-gradient(ellipse at 90% 85%, rgba(0,0,0,.6), transparent 70%);
  mask: radial-gradient(ellipse at 15% 0%, rgba(0,0,0,.6), transparent 70%),
        radial-gradient(ellipse at 90% 85%, rgba(0,0,0,.6), transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Landing page styles */
.landing-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.landing-header {
  padding: 1rem 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background-color: #1a1d29;
  border-bottom: 1px solid #1f2430;
}

.landing-header h1 {
  color: #6c5ce7;
}

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  gap: 2rem;
}

/* Hero text */
.hero-text {
  max-width: 50%;
}

.hero-text h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.wallet-label {
  font-size: 0.875rem;
  color: #8b949e;
  margin-bottom: 0.25rem;
}

.wallet-address {
  font-size: 1.1rem;
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px 14px;
  border-radius: 12px;
}

.primary-btn {
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #15171b, #060708);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 22px rgba(0,0,0,.55);
  position: relative;
  overflow: hidden;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.7);
}

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

.primary-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,92,255,.35);
}

/* Ripple animation for primary buttons */
.primary-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.primary-btn:active::after {
  width: 200%;
  height: 200%;
  transition: 0s;
}

/* Hero image */
.hero-image img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 8px;
}

/* Modal overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #1a1d29;
  padding: 2rem;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* Receive modal specific styling */
#receive-modal .modal-content {
  max-width: 520px;
  padding: 2.5rem;
}

#receive-modal h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

#receive-modal p {
  color: #8b949e;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-step.hidden {
  display: none;
}

.auth-step h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

input[type='file'],
input[type='text'],
input[type='password'],
input[type='number'],
select {
  padding: 0.6rem 0.8rem;
  border: 1px solid #2b2f3b;
  border-radius: 6px;
  background-color: #0f1419;
  color: #ffffff;
  font-size: 0.9rem;
}

input[type='file'] {
  color: #8b949e;
}

input[type='text']::placeholder,
input[type='password']::placeholder,
input[type='number']::placeholder {
  color: #5f6a7d;
}

/* Form input focus states */
input[type='text']:focus,
input[type='password']:focus,
input[type='number']:focus,
select:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

/* Select dropdown styling */
select {
  cursor: pointer;
}

select option {
  background-color: #0f1419;
  color: #ffffff;
}

.error-msg {
  font-size: 0.8rem;
  color: #e53935;
  min-height: 1rem;
}

/* ------------------------------------------------------------------ */
/* Form group helper to align labels with their fields in modals */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ------------------------------------------------------------------ */
/* Light theme overrides. When the body has the class light-theme,
   switch colours to a light palette. This provides a simple dark/light
   mode toggle via the settings panel. The base colours are inverted
   to maintain readability. */
body.light-theme {
  background-color: #f5f5f5;
  color: #0f1419;
}
body.light-theme .sidebar {
  background-color: #ffffff;
  color: #0f1419;
}
body.light-theme .sidebar .nav-item.active {
  background-color: #e6e6e6;
}
body.light-theme .main-content,
body.light-theme .content-wrapper,
body.light-theme .modal-content {
  background-color: #ffffff;
  color: #0f1419;
}
body.light-theme .assets-table th,
body.light-theme .assets-table td {
  color: #0f1419;
}
body.light-theme .badge,
body.light-theme .badge-dot {
  background-color: #6c5ce7;
  color: #ffffff;
}

/* Send modal adjustments                                              */
/* Increase width and stack children vertically with spacing */
#send-modal .modal-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.code-box {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.1rem;
  padding: 0.8rem 1rem;
  background-color: #0f1419;
  border: 1px solid #2b2f3b;
  border-radius: 6px;
  text-align: center;
  user-select: all;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: #8b949e;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

/* Sections that are hidden until activated (e.g., transactions panel) */
.hidden-section {
  display: none;
}

/* Copy button inside receive modal */
.copy-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(180deg, #15171b, #060708);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
}

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

/* Row layout for address and copy button */
.address-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* Address styling in receive modal */
#receive-address {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  color: #6c5ce7;
  letter-spacing: 0.2px;
  word-break: break-all;
  line-height: 1.4;
}

/* QR code container styling */
#qrcode {
  margin: 24px 0;
  display: flex;
  justify-content: center;
  padding: 20px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 12px;
}

/* ------------------------------------------------------------------ */
/* Coming soon overlay shown when navigating to unimplemented sections */
.coming-soon {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(26, 29, 41, 0.95);
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  font-size: 1rem;
}
.coming-soon.hidden {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .landing-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-text {
    max-width: 100%;
    margin-bottom: 2rem;
  }
  .hero-image img {
    max-width: 100%;
  }
}

/* ------------------------------------------------------------------ */
/* Dashboard styles */
/* The dashboard layout mirrors the Ledger Live desktop application.    */
/* It comprises a collapsible sidebar, a top bar with status icons and */
/* a main content area with portfolio information, charts and tables. */

.dashboard {
  display: flex;
  min-height: 100vh;
  background-color: #0f1419;
  color: #ffffff;
}

/* Sidebar */
/* Sidebar styling: darker blacks with subtle highlights */
.sidebar {
  width: 260px;
  background-color: #13181e;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  border-right: 1px solid #1f2430;
}

.sidebar .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  width: 100%;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  color: #8b949e;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Navigation hover and active states use a subtle dark highlight */
.nav-item:hover {
  background-color: #1f2430;
  color: #ffffff;
}

.nav-item.active {
  background-color: #1f2430;
  color: #ffffff;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Badge styling */
.nav-item .badge {
  margin-left: auto;
  background-color: #5c6bc0;
  color: #ffffff;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Starred accounts placeholder */
.starred {
  margin-top: auto;
  font-size: 0.75rem;
  color: #5f6a7d;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1f2430;
}

.top-bar .status-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: #6c5ce7;
}

.top-bar .status-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 1rem;
}

.status-icon {
  position: relative;
  cursor: pointer;
  color: #8b949e;
  transition: color 0.2s ease;
}

.status-icon:hover {
  color: #ffffff;
}

/* Notification badge */
.status-icon .badge-dot {
  position: absolute;
  top: -3px;
  right: -4px;
  background-color: #d63e4d;
  color: #ffffff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Social media icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #b8bcc4;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

/* Main content */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero banner */
.hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1a1d29;
  border-radius: 8px;
  padding: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-banner .banner-text h4 {
  font-size: 1rem;
  font-weight: 500;
  color: #8b949e;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.hero-banner .banner-text h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.hero-banner .banner-text p {
  font-size: 0.85rem;
  color: #5f6a7d;
}

.hero-banner .banner-graphic {
  flex-shrink: 0;
}

.hero-banner .banner-graphic svg {
  width: 150px;
  height: auto;
  fill: none;
  stroke: #6c5ce7;
  stroke-width: 2;
}

/* Shop button styling */
.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #15171b, #060708);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
  text-decoration: none;
  text-transform: uppercase;
}

.shop-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,.6);
  color: #fff;
  text-decoration: none;
}

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

.shop-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,92,255,.35);
}

/* Balance and chart section */
.balance-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.total-balance {
  background-color: #1a1d29;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 240px;
  min-width: 240px;
}

.total-balance .label {
  font-size: 0.85rem;
  color: #8b949e;
}

.total-balance .value {
  font-size: 2.5rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.total-balance .value .arrow {
  color: #00d68f;
  font-size: 1.5rem;
}

.time-filters {
  display: flex;
  gap: 0.5rem;
}

.time-filters button {
  background-color: #1a1d29;
  border: 1px solid #2b2f3b;
  color: #8b949e;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.time-filters button.active {
  background-color: #5c6bc0;
  color: #ffffff;
  border-color: #5c6bc0;
}

.time-filters button:hover {
  background-color: #2b2f3b;
  color: #ffffff;
}

/* Chart container */
.chart-container {
  background-color: #1a1d29;
  border-radius: 8px;
  padding: 1.5rem;
  flex: 3 1 500px;
  min-width: 300px;
}

.chart-container canvas {
  width: 100%;
  height: 300px;
}

/* Rewards section */
/* The rewards section from the previous version is hidden in the simplified
   layout.  We keep the class for compatibility but hide it entirely. */
.rewards-section {
  display: none;
}

.rewards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.rewards-header .title {
  font-size: 1.25rem;
  font-weight: 600;
}

.rewards-header .time-filters {
  gap: 0.25rem;
}

.progress-bar {
  height: 10px;
  width: 100%;
  background: linear-gradient(90deg, #00d68f 0%, #6c5ce7 100%);
  border-radius: 5px;
  margin: 0.5rem 0 1rem;
}

.rewards-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.rewards-summary .summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rewards-summary .summary-item .label {
  font-size: 0.75rem;
  color: #8b949e;
}

.rewards-summary .summary-item .value {
  font-size: 1.1rem;
  font-weight: 600;
}

.rewards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rewards-table th,
.rewards-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.rewards-table thead th {
  color: #8b949e;
  font-weight: 600;
  border-bottom: 1px solid #2b2f3b;
}

.rewards-table tbody tr:not(:last-child) {
  border-bottom: 1px solid #2b2f3b;
}

.rewards-table tbody td {
  vertical-align: middle;
}

.rewards-table .account-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

.rewards-table .account-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ------------------------------------------------------------------ */
/* History section */
/* A table listing recent transactions with search and filter options. */

.history-section {
  background-color: #1a1d29;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.history-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.history-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.history-controls input[type='text'] {
  padding: 0.4rem 0.8rem;
  background-color: #0f1419;
  border: 1px solid #2b2f3b;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.8rem;
  min-width: 200px;
}

.history-controls input[type='text']::placeholder {
  color: #5f6a7d;
}

.history-controls select {
  padding: 0.4rem 0.8rem;
  background-color: #0f1419;
  border: 1px solid #2b2f3b;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.8rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  overflow-x: auto;
}

.history-table th,
.history-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.history-table thead th {
  color: #8b949e;
  font-weight: 600;
  border-bottom: 1px solid #2b2f3b;
  white-space: nowrap;
}

.history-table tbody tr:not(:last-child) {
  border-bottom: 1px solid #2b2f3b;
}

.history-table tbody td {
  vertical-align: middle;
  white-space: nowrap;
}

/* Loader for transaction history */
.loader {
  text-align: center;
  margin: 1rem 0;
  color: #6c5ce7;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loader::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #6c5ce7;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Hide loaders when data is loaded */
.loader.hidden {
  display: none;
}
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Assets section: lists token balances and fiat values */

.assets-section {
  background-color: #13181e;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.assets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.assets-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.assets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.assets-table th,
.assets-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.assets-table thead th {
  color: #8b949e;
  font-weight: 600;
  border-bottom: 1px solid #1f2430;
}

.assets-table tbody tr:not(:last-child) {
  border-bottom: 1px solid #1f2430;
}

.assets-table tbody td {
  vertical-align: middle;
}

.assets-table .asset-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.assets-table .asset-symbol {
  font-size: 0.75rem;
  color: #8b949e;
}