:root {
  --primary-color: #00ffcc;
  --secondary-color: #0f3460;
  --text-color: #e0e0e0;
  --accent-color: #a9a9e9;
  --error-color: #ff4444;
  --success-color: #00c853;
  --border-radius: 8px;
  --transition-speed: 0.3s;
  --link-color: #00ffcc;
  --link-hover-color: #00e6b8;
}

/* Base styles */
* {
  margin: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--secondary-color);
  color: var(--text-color);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Link Styles */
a {
  color: var(--link-color);
  text-decoration: none;
  position: relative;
  transition: all var(--transition-speed) ease;
  padding-bottom: 2px;
}

a:hover {
  color: var(--link-hover-color);
}

a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--link-hover-color);
  transition: width var(--transition-speed) ease;
}

a:hover::after {
  width: 100%;
}

a:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 4px;
  border-radius: 2px;
}

a:active {
  transform: translateY(1px);
}

/* Email links special styling */
a[href^="mailto:"] {
  padding-left: 1.5em;
  position: relative;
}

a[href^="mailto:"]::before {
  content: '✉';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1em;
}

/* Typography */
h1, h2, h3 {
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* File Input Styles */
.file-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.file-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition-speed);
}

.file-group:hover {
  background: rgba(255, 255, 255, 0.1);
}

.input-wrapper {
  flex: 1;
  display: flex;
  gap: 1rem;
}

.file-input,
.password-input {
  padding: 0.75rem;
  border: 1px solid var(--accent-color);
  border-radius: var(--border-radius);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-color);
  transition: var(--transition-speed);
}

.file-input:hover,
.password-input:hover {
  border-color: var(--primary-color);
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-speed);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.primary-btn {
  background: var(--primary-color);
  color: var(--secondary-color);
}

.primary-btn:hover {
  background: #00e6b8;
}

.remove-file-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 0, 0, 0.2);
}

.remove-file-btn:hover {
  background: rgba(255, 0, 0, 0.3);
}

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* Debug Section */
.debug-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
}

.debug-output {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;       /* Preserves whitespace and wraps text */
    word-wrap: break-word;       /* Breaks long words to prevent overflow */
    max-width: 100%;            /* Ensures content doesn't overflow container */
    overflow-x: auto;           /* Adds horizontal scroll if needed */
    color: var(--accent-color);
}

/* Footer Styles */
.footer {
  background: rgba(0, 0, 0, 0.2);
  padding: 2rem;
  margin-top: 3rem;
}

.footer-section {
  margin-bottom: 2rem;
}

.toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-speed);
}

.toggle-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toggle-arrow {
  transition: var(--transition-speed);
}

.content {
  display: none;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Legal Grid */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.legal-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: var(--border-radius);
}

/* Donation Section */
.donate-section {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
}

.donation-addresses {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.address-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.currency {
  color: var(--primary-color);
  font-weight: bold;
  min-width: 60px;
}

.address {
  word-break: break-all;
  font-family: monospace;
}

/* Loader */
.loader-container {
    position: fixed;
    inset: 0;
    background: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}
.loader-message {
    color: var(--text-color);
    margin-bottom: 1rem;
}
.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--accent-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Section Styles */
.results-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  padding: 0;
  overflow: hidden;
}

.results-section h2 {
  background: rgba(0, 0, 0, 0.3);
  margin: 0;
  padding: 1.5rem;
  color: var(--primary-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-section {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-section:last-child {
  border-bottom: none;
}

.result-section h3 {
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.result-section h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--primary-color);
  margin-right: 0.75rem;
  border-radius: 2px;
}

.result-section pre {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--border-radius);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  word-break: break-all;
  white-space: pre-wrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-section pre:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
  transition: all var(--transition-speed) ease;
}

.check-balance-btn {
  margin: 1rem 0;
  background: var(--primary-color);
  color: var(--secondary-color);
  font-weight: 500;
}

#balanceDisplay {
  display: none;
}

.check-balance-btn:hover {
  background: var(--link-hover-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Raw Output Section */
#rawOutput {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#rawOutput pre {
  margin: 0;
  padding: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--accent-color);
}

/* Key Groups */
.key-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.key-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-item:hover {
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.3);
  transition: all var(--transition-speed) ease;
}

.key-label {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.key-value {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.copy-icon {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding-left: 0.5rem;
}

.copy-icon:hover {
    opacity: 1;
}

.copy-icon:active {
    transform: scale(0.95);
}

pre {
    position: relative;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Scheme Selection Styles */
.scheme-selection {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition-speed);
}

.scheme-selection:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.scheme-selection > label {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.75rem;
    display: block;
}

.scheme-options {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.scheme-options input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.scheme-options label {
    color: var(--text-color);
    font-weight: normal;
    margin-bottom: 0;
    display: inline;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.scheme-options label:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .result-section {
      padding: 1rem;
    }

    .key-group {
      grid-template-columns: 1fr;
    }

    .result-section pre {
      font-size: 0.8rem;
      padding: 0.75rem;
    }
  }
}

/* Utility Classes */
.hidden {
  display: none;
}