:root {
  --bg: #0f0b1a;
  --surface: #1a1625;
  --card: #252033;
  --input-bg: #1f2937;
  --border: #374151;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent: #a855f7;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--bg), #1e1b4b);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.title {
  color: var(--primary);
  font-size: 3rem;
  font-weight: 700;
}

.subtitle {
  color: var(--text-muted);
  margin: 0.5rem 0 1.5rem;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.connection-status.connected {
  background: rgba(16,185,129,0.1);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}

.connection-status.disconnected {
  background: rgba(239,68,68,0.1);
  color: var(--error);
  border: 1px solid rgba(239,68,68,0.3);
}

.network-label,
.network-select {
  margin: 1rem 0;
}

.network-select {
  padding: 0.5rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.network-select:focus {
  outline: none;
  border-color: var(--primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px,1fr));
  gap: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-header2 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: .2rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-content {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--text);
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--input-bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.keypair-display {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.key-input-group {
  display: flex;
  gap: 0.5rem;
}

.btn-toggle {
  margin-left: .5rem;
  margin-right: .2rem;
}

.btn-copy,
.btn-toggle {
  padding: 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover,
.btn-toggle:hover {
  background: var(--surface);
}

.warning {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.9rem;
}

.drop-area {
  position: relative;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.drop-area.highlight,
.drop-area:hover {
  background: rgba(139,92,246,0.05);
  border-color: var(--primary);
}

.image-preview {
  margin-top: 1rem;
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

.advanced-options {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
}

.submit-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.transaction-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
}

.transaction-status {
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.transaction-status.success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--success);
}

.transaction-status.error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--error);
}

.hidden {
  display: none !important;
}

/* Network toggle */
.network-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  transition: var(--transition);
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
}

input:checked + .slider::before {
  transform: translateX(26px);
}

/* Asset‐preview box */
.asset-preview {
  width: 350px;
  margin: 1.5rem auto;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.preview-name {
  font-weight: 600;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.preview-code {
  height: fit-content;
  font-family: monospace;
  border: 1px solid var(--border);
  background: var(--input-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.preview-image {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  border: 3px solid var(--border);
}

.preview-supply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: right;
  margin-bottom: .25rem;
}

#preview-clawback {
  margin-left: .3rem;
}

#preview-supply {
  margin-left: auto;
}

.preview-description details {
  text-align: left;
  font-weight: 600;
}

.preview-description summary{
  display: flex;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  padding-left: .2rem;
  padding-right: .2rem;
  background: var(--card);
  font-size: 1rem;
  margin-top: .5rem;
  margin-bottom: .25rem;
}

.preview-redemption details {
  text-align: left;
  font-weight: 600;
}

.preview-redemption summary {
  cursor: pointer;
  font-weight: 500;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.preview-conditions details {
  text-align: left;
  font-weight: 600;
}

.preview-conditions summary {
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.preview-lock {
  font-size: 1.3em;
}

.preview-text {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top-left-radius: 0px;
  box-shadow: var(--shadow);
  padding: .4rem;
}

/* lock group */
.lock-status {
  font-size: 26px;
}

.lock-group .lock-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.lock-line > label[for="account-lock-toggle"] {
  margin-right: 0.5em;
}

.lock-group .warning-text {
  margin: 0.5em 0 0 0;
  font-size: 0.9em;
  font-weight: 600;
  color: #b71c1c;
}

/* hide advanced options by default */
.advanced-options.hidden,
#asset-preview.hidden {
  display: none !important;
}

.title-icon {
  width: 1em;
  height: 1em;
  vertical-align: text-bottom;
  top: 20px;
  margin-bottom: 0.12em;
  margin-right: 0.25em;
}

.flag-icon {
  display: block;       
  width: 1.7em;
  height: 1.7em;
  filter: invert(1) brightness(2);
}

.secret-box {
  width: 100%;
}

.secret-input-box {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}


.preview-flag {
  display: none;
  height: fit-content;
  font-family: monospace;
  background: var(--input-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.preview-domain {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: small;
  font-weight: 600;
  margin-top: .9rem;
  color: var(--border);
}

.warning-text {
  color: red;
  font-weight: 500;
  text-transform: uppercase;
}

.admin {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: black; padding: 20px;
  border: 4px outset rgb(186, 157, 255);
  z-index: 1000; max-height: 80vh;
  overflow-y: auto;
}

/* Carousel wrapper */
.carousel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

/* Track that holds the two cards */
.carousel-track {
  display: flex;
  overflow: hidden;
  width: 100%;
  gap: 0.5rem;
}

/* Prev/Next buttons */
.carousel-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-btn:hover:not(:disabled) {
  background: var(--input-bg);
  transform: translateY(-1px);
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#distribution-ops {
  position: absolute;
  top: 0;
  right: -3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.op-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.op-btn:hover {
  background: var(--input-bg);
}

/* Individual collection cards */
.collection-card {
  flex: 0 0 calc(50% - 0.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  transition: var(--transition);
}

.collection-card:hover {
  background: var(--card);
}

/* Image inside card */
.collection-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Label under image */
.collection-label {
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
}

.content-area {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

.distribution-sidebar {
  position: fixed;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  display: flex;
  top: 2rem;          
  left: 2rem;
  width: 290px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  z-index: 10;
}

.distribution-sidebar h2 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.distribution-assets-carousel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: .3rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background-color: var(--bg);
}

.asset-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 5rem;
  flex-shrink: 0;
  cursor: pointer;
}

.asset-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border-top-right-radius: var(--radius);
  border-top-left-radius: var(--radius);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.asset-code {
  width: 100%;
  font-size: 0.60rem;
  text-align: center;
  color: var(--text);
  word-break: break-all;
  border-top-right-radius: 0;
  border-top-left-radius: 0;
  border-bottom-right-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.wallet-address {
  font-family: monospace;
  background: var(--input-bg);
  color: var(--text);
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
  margin-bottom: 1rem;
}

#connect-dist-account {
  margin-top: .5rem;
}

#change-dist-account {
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .content-area {
    display: block;
  }
  .distribution-sidebar {
    margin-bottom: 2rem;
    position: static;
  }
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}