/* CSS Variables */
:root {
  --bg-primary: #07080a;
  --bg-secondary: #0c0e12;
  --card-bg: rgba(15, 18, 24, 0.65);
  --card-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #d9a74a;
  --accent-glow: rgba(217, 167, 74, 0.15);
  --accent-hover: #f5c05f;
  --green: #10b981;
  --red: #ef4444;
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-speed: 0.3s;
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Glows */
.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.sphere-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.sphere-2 {
  width: 600px;
  height: 600px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

@media (min-width: 1024px) {
  .app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    padding: 3rem;
  }
}

/* Sidebar Styling */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #a47625 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(217, 167, 74, 0.3);
}

.brand-logo i {
  font-size: 1.5rem;
  color: var(--bg-primary);
}

.brand-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-logo {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  display: block;
}

/* Stats Panel in Sidebar */
.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  backdrop-filter: blur(8px);
  transition: transform var(--transition-speed), border var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-online {
  color: var(--green);
}

.status-online i {
  font-size: 0.6rem;
  animation: pulse 2s infinite;
}

.text-gold {
  color: var(--accent);
}

/* Main Dashboard Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Grid layout for form and results */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-layout {
    grid-template-columns: 380px 1fr;
  }
}

/* Glassmorphism Card Style */
.card {
  background-color: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.icon-gold {
  color: var(--accent);
}

/* Form inputs styling */
.form-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.custom-select-wrapper select {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border var(--transition-speed);
}

.custom-select-wrapper select:focus {
  border-color: var(--accent);
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-generate {
  background: linear-gradient(135deg, var(--accent) 0%, #a47625 100%);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(217, 167, 74, 0.2);
  margin-top: 0.5rem;
}

.btn-generate:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 167, 74, 0.3);
}

.btn-generate:active {
  transform: translateY(1px);
}

.btn-refresh {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem;
  border-radius: 8px;
}

.btn-refresh:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Result panel specific styles */
#result-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
  position: relative;
}

.result-placeholder {
  text-align: center;
  padding: 2rem;
}

.placeholder-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.result-placeholder h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.result-placeholder p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
}

.result-loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.result-loading h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.result-loading p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8rem;
}

.result-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-green {
  color: var(--green);
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(217, 167, 74, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.copy-field {
  display: flex;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.copy-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.copy-field input.text-small {
  font-size: 0.72rem;
}

.btn-copy, .btn-reveal {
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 0 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-copy:hover, .btn-reveal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-reveal {
  border-right: none;
}

/* Metadata row */
.metadata-row {
  display: flex;
  gap: 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.meta-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-value.text-small {
  font-size: 0.68rem;
}

/* Database Table Styles */
.table-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.table-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .table-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.search-box {
  position: relative;
  width: 100%;
}

@media (min-width: 640px) {
  .search-box {
    width: 250px;
  }
}

.search-box i {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-box input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border var(--transition-speed);
}

.search-box input:focus {
  border-color: var(--accent);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(0, 0, 0, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Custom Table Columns styling */
.col-coin {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}

.col-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-date {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.table-key-reveal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-key-reveal input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
  width: 90px;
  cursor: pointer;
}

.table-key-reveal button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-speed);
}

.table-key-reveal button:hover {
  color: var(--text-primary);
}

.table-loader {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
}

.table-loader i {
  margin-right: 0.5rem;
}

/* Toast Notifications styling */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: rgba(18, 22, 28, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--accent);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  animation: slideIn 0.3s forwards;
}

.toast.toast-success {
  border-left-color: var(--green);
}

.toast.toast-error {
  border-left-color: var(--red);
}

.toast i {
  font-size: 1rem;
}

.toast-success i {
  color: var(--green);
}

.toast-error i {
  color: var(--red);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

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

/* Utility classes */
.hidden {
  display: none !important;
}

/* Dark Input Fields */
.input-dark {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-speed);
}

.input-dark:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Custom Tokens List Registry */
.custom-tokens-list {
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

.custom-tokens-list h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.token-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.01);
}

.token-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition-speed);
}

.token-list-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.01);
}

.token-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.token-symbol {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.token-network-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  width: fit-content;
}

.token-details-text {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
}

.token-address-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.btn-delete-token {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all var(--transition-speed);
}

.btn-delete-token:hover {
  color: var(--red);
  background-color: rgba(239, 68, 68, 0.1);
}
