/* ========================================
   Light Theme Design System for PlayXO.com
   ======================================== */

/* CSS Variables / Design Tokens */
:root {
  /* Color Palette - Light & Clean */
  --px-bg: #f8f9fa;
  --px-bg-gradient-1: #667eea;
  --px-bg-gradient-2: #764ba2;
  --px-surface: #ffffff;
  --px-surface-elevated: #ffffff;
  --px-card: rgba(255, 255, 255, 0.95);
  --px-card-hover: rgba(255, 255, 255, 1);

  /* Text Colors */
  /* Text Colors */
  --px-text: #000000;
  /* Pure Black */
  --px-text-secondary: #1a202c;
  /* Very Dark Gray */
  --px-muted: #4a5568;
  /* Darker Muted */

  /* ... (keeping other vars unchanged if not targeted) ... */

  /* ... (skipping to table styles) ... */

  /* ========================================
   Bitcoin List Page - ULTRA COMPACT LAYOUT
   ======================================== */

  .bitcoin_list {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    /* 12px base */
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--px-border);
    overflow: hidden;
    /* For container rounding */
  }

  /* Header row style if needed, or just container modification */

  .wallet {
    border-left-width: 4px;
    border-left-style: solid;
    border-color: transparent;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0;
    border-radius: 0;
    background: white;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid #e2e8f0;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .wallet:last-child {
    border-bottom: none;
  }

  .wallet:hover {
    background: #edf2f7;
  }

  .wallet .row {
    margin: 0;
    align-items: center;
  }

  .wallet .col-lg-5,
  .wallet .col-lg-3,
  .wallet .col-lg-1 {
    padding: 0 0.5rem;
  }

  .wallet .col-lg-5 {
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 0.75rem;
    line-height: 1.25;
    font-weight: 500;
    /* Bolder monospace */
    color: #2d3748;
  }

  .wallet .col-lg-1 {
    font-weight: 600;
  }

  /* Link colors in table */
  .wallet a {
    color: #3182ce;
    /* Standard accessible blue */
    text-decoration: none;
  }

  .wallet a:hover {
    text-decoration: underline;
    color: #2c5282;
  }

  .wallet .col-lg-2 {
    padding: 0 0.5rem;
    font-size: 0.75rem;
  }

  /* Color Palette - Light & Clean */
  --px-bg: #f8f9fa;
  --px-surface: #ffffff;
  --px-surface-elevated: #ffffff;
  --px-card: #ffffff;
  --px-card-hover: #ffffff;

  /* Text Colors */
  --px-text: #000000;
  /* Pure Black */
  --px-text-secondary: #333333;
  /* Dark Gray */
  --px-muted: #555555;
  /* Medium Gray */

  /* Border & Dividers */
  --px-border: #e5e7eb;
  --px-border-subtle: #f3f4f6;

  /* Brand Colors - SOLID */
  --px-brand: #2563eb;
  /* Royal Blue */
  --px-brand-hover: #1d4ed8;
  --px-brand-gradient: #2563eb;
  /* Fallback to solid */

  /* Semantic Colors */
  --px-success: #16a34a;
  --px-success-bg: #dcfce7;
  --px-warning: #ca8a04;
  --px-warning-bg: #fef9c3;
  --px-danger: #dc2626;
  --px-danger-bg: #fee2e2;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
  0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
  0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
  0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
  0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Typography */
  --font-sans: 'Inter',
  system-ui,
  -apple-system,
  sans-serif;
  --font-mono: 'SF Mono',
  'Roboto Mono',
  Menlo,
  monospace;
}

/* ========================================
   Base Styles
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: #f3f4f6;
  /* Solid light gray background, no gradient */
  color: var(--px-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ========================================
   Typography
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--px-text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.875rem);
}

p {
  line-height: 1.7;
  color: var(--px-text-secondary);
}

a {
  color: var(--px-brand);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--px-brand-hover);
  text-decoration: underline;
}

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

/* ========================================
   Layout Components
   ======================================== */

.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}

.px-content {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-2xl);
  min-height: calc(100vh - 400px);
}

/* ========================================
   Card Components
   ======================================== */

.px-card {
  background: var(--px-card);
  border: 1px solid var(--px-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.px-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.px-surface {
  background: var(--px-surface);
  border: 1px solid var(--px-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.px-hero {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
  border: 1px solid var(--px-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.px-shadow-soft {
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Navigation
   ======================================== */

.navbar.bg-dark {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--px-border);
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 600;
  transition: transform var(--transition-base);
  color: var(--px-text) !important;
}

.navbar-brand svg {
  stroke: var(--px-brand) !important;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--px-text-secondary) !important;
  transition: color var(--transition-fast);
  position: relative;
  font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: var(--px-text) !important;
}

.navbar-dark .navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--px-brand);
  transition: width var(--transition-base);
}

.navbar-dark .navbar-nav .nav-link:hover::after {
  width: 80%;
}

.navbar-toggler {
  border-color: var(--px-border) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(26, 32, 44, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.5rem;
  transition: all var(--transition-base);
  border: none;
}

.btn-primary {
  background: var(--px-brand);
  border: 1px solid var(--px-brand);
  color: white;
  box-shadow: none;
  /* Flat design */
}

.btn-primary:hover {
  background: var(--px-brand-hover);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-outline-light {
  border: 1px solid var(--px-border);
  color: var(--px-text);
  background: white;
}

.btn-outline-light:hover {
  background: var(--px-surface-elevated);
  border-color: var(--px-brand);
  color: var(--px-brand);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ========================================
   Footer
   ======================================== */

.px-footer {
  background: var(--px-surface);
  border-top: 1px solid var(--px-border);
  margin-top: var(--spacing-2xl);
}

.px-footer a {
  color: var(--px-text-secondary);
  transition: color var(--transition-fast);
}

.px-footer a:hover {
  color: var(--px-brand);
  text-decoration: underline;
}

.px-footer svg {
  stroke: var(--px-text) !important;
  fill: var(--px-text) !important;
}

/* ========================================
   Bitcoin List Page - ULTRA COMPACT LAYOUT
   ======================================== */

.bitcoin_list {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--px-border);
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wallet {
  border-left: 4px solid transparent;
  padding: 0;
  /* Removing padding to let grid handle it */
  margin: 0;
  border-radius: 0;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.wallet:last-child {
  border-bottom: none;
}

.wallet:hover {
  background: #f1f5f9;
}

.wallet .row {
  margin: 0;
  align-items: center;
  min-height: 28px;
  /* Fixed height for consistency */
  flex-wrap: nowrap;
  /* PREVENT WRAPPING */
}

.wallet [class^="col-"] {
  padding: 0 6px;
  white-space: nowrap;
  /* Force single line */
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

/* Adjust column widths for better fit */
.wallet .col-lg-1 {
  flex: 0 0 100px;
  /* Fixed width for balance segment */
  max-width: 100px;
}

.wallet .col-lg-5 {
  flex: 1 1 auto;
  /* Private key takes available space */
}

.wallet .col-lg-3 {
  flex: 0 0 20%;
  /* Fixed proportion for addresses */
  max-width: 20%;
}

/* Columns specific styling */
.wallet-balance {
  font-weight: 700;
  color: #111827;
  margin-right: 4px;
}

.wallet-tx {
  color: #6b7280;
  font-size: 0.7rem;
}

.wallet .col-lg-5 {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  color: #1a202c;
  /* Almost black for keys */
  font-weight: 500;
}

/* Links inside table */
.wallet a {
  color: #2563eb;
}

.wallet a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* Compact wallet states */
/* Compact wallet states */
.loading {
  border-left-color: #9ca3af !important;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.empty {
  border-left-color: #ef4444 !important;
}

.used {
  border-left-color: #f59e0b !important;
  background: #fffbeb;
}

.filled {
  border-left-color: #16a34a !important;
  background: #f0fdf4;
  font-weight: 700;
}

/* ========================================
   Article / Blog Styles
   ======================================== */

.prose {
  line-height: 1.75;
  max-width: 65ch;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.025em;
  color: var(--px-text);
}

.prose h1 {
  font-size: 2.25rem;
}

.prose h2 {
  font-size: 1.875rem;
}

.prose h3 {
  font-size: 1.5rem;
}

.prose p {
  margin-bottom: var(--spacing-md);
  color: var(--px-text-secondary);
}

/* :not(.btn) обязателен: иначе это правило перебивает .btn-primary по
   специфичности и кнопка внутри .prose получает синий текст на синем фоне. */
.prose a:not(.btn) {
  color: var(--px-brand);
  font-weight: 500;
}

.prose a:not(.btn):hover {
  color: var(--px-brand-2);
  text-decoration: underline;
}

.prose ul,
.prose ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.prose li {
  margin-bottom: var(--spacing-sm);
}

.prose code {
  background: rgba(102, 126, 234, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: var(--px-brand-2);
  border: 1px solid rgba(102, 126, 234, 0.2);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.prose pre {
  background: #f7fafc;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--px-border);
}

.prose blockquote {
  border-left: 4px solid var(--px-brand);
  padding-left: var(--spacing-md);
  margin-left: 0;
  margin-bottom: var(--spacing-md);
  font-style: italic;
  color: var(--px-muted);
}

/* ========================================
   Utilities
   ======================================== */

.flex-equal>* {
  flex: 1;
}

@media (min-width: 768px) {
  .flex-md-equal>* {
    flex: 1;
  }
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--spacing-md);
  font-size: 2rem;
  color: #fff;
  border-radius: var(--radius-md);
  background: var(--px-brand-gradient);
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap var(--transition-base);
}

.icon-link:hover {
  gap: 0.5rem;
}

.icon-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  border-radius: var(--radius-md);
}

.rounded-4 {
  border-radius: var(--radius-md);
}

.rounded-5 {
  border-radius: var(--radius-lg);
}

.text-shadow-1 {
  text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

.text-shadow-2 {
  text-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.text-shadow-3 {
  text-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-sm);
}

.text-bg-dark {
  color: #fff !important;
  background-color: var(--px-text-secondary) !important;
}

.bg-primary {
  background-color: var(--px-brand) !important;
}

.bg-opacity-10 {
  opacity: 1 !important;
  background-color: rgba(102, 126, 234, 0.1) !important;
}

.text-primary {
  color: var(--px-brand) !important;
}

/* ========================================
   Mobile Optimizations
   ======================================== */

@media (max-width: 767px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .px-hero {
    border-radius: var(--radius-lg);
  }

  .navbar-collapse {
    background: rgba(255, 255, 255, 0.98);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--px-border);
  }

  .wallet {
    font-size: 0.7rem;
  }

  .wallet .col-lg-5,
  .wallet .col-lg-2 {
    font-size: 0.7rem;
  }
}

/* Utility for disabled elements */
.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Touch-friendly tap targets on mobile */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    padding: 0.75rem 1rem;
  }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ========================================
   Accessibility
   ======================================== */

.visually-hidden-focusable {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:active,
.visually-hidden-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

:focus-visible {
  outline: 2px solid var(--px-brand);
  outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Light backgrounds for better readability */
.bg-light {
  background-color: #ffffff !important;
  color: var(--px-text) !important;
}

/* Accordion fixes for light theme */
.accordion-button {
  background-color: transparent !important;
  color: var(--px-text) !important;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(102, 126, 234, 0.05) !important;
  color: var(--px-brand) !important;
}

.accordion-body {
  color: var(--px-text-secondary) !important;
}