@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Roboto:wght@400;500;700&display=swap');

:root {
  --background-color: #0A0C0F;
  --surface-color: #151A20;
  --text-color: #E1E6EB;
  --text-secondary-color: #A1A7B3;
  
  /* Main color from user */
  --primary-color: #00f6ff;
  
  /* Accent colors */
  --accent-color-1: #8A2BE2; /* BlueViolet for gradients */
  --accent-color-2: #FF00FF; /* Magenta for highlights */

  --border-color: rgba(0, 246, 255, 0.2);
  --disabled-bg: #2A303C;
  --disabled-text: #6C757D;

  --glow-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 15px var(--accent-color-1);
  --text-glow: 0 0 3px var(--text-color);
  
  --border-radius: 12px;
  --border-radius-small: 8px;
}

body {
  background: radial-gradient(circle, #151A20 0%, #0A0C0F 100%);
  color: var(--text-color);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  padding: 0;
  padding-bottom: 80px; /* Space for bottom nav */
  text-shadow: var(--text-glow);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: rgba(10, 12, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.75rem;
  font-weight: bold;
  background: linear-gradient(90deg, var(--accent-color-2), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.5);
}

/* App container */
main {
  flex-grow: 1;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.page {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.main-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background-color: rgba(10, 12, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 10;
  padding: 0.25rem 0;
}

.nav-button {
  flex-grow: 1;
  background: none;
  border: none;
  color: var(--text-secondary-color);
  padding: 0.75rem 0;
  cursor: pointer;
  border-top: 4px solid transparent;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.nav-button:hover {
    color: var(--primary-color);
}

.nav-button.active {
  color: var(--primary-color);
  border-top-color: var(--primary-color);
  text-shadow: 0 0 5px var(--primary-color);
}

.page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.25rem;
  font-weight: bold;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(90deg, var(--primary-color), white);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(0, 246, 255, 0.3);
}

.text-center {
  text-align: center;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

/* Common Components */
.card {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  text-align: left;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0, 246, 255, 0.05);
}

.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card-grid-small {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-color);
}

.referral-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.referral-link-container input {
    width: 100%;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem;
    border-radius: var(--border-radius-small);
    font-family: 'Roboto', sans-serif;
}

.referral-link-container button {
    background: linear-gradient(90deg, var(--accent-color-1), var(--primary-color));
    color: white;
    font-weight: bold;
    border: none;
    padding: 0 1.5rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.3s ease;
}

.referral-link-container button:hover {
    box-shadow: var(--glow-shadow);
}

.form-group {
    margin: 1.5rem 0;
}

#referrer-address {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#referrer-address:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 246, 255, 0.3);
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.card-title {
  color: var(--disabled-text);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: bold;
}

.progress-bar-container {
  width: 100%;
  background-color: var(--secondary-color);
  border-radius: 9999px;
  height: 1rem;
  margin: 1rem 0;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent-color-1), var(--primary-color));
  height: 1rem;
  border-radius: 9999px;
  transition: width 0.5s;
  box-shadow: 0 0 8px rgba(0, 246, 255, 0.5);
}

.action-button {
  background: linear-gradient(90deg, var(--accent-color-2), var(--primary-color));
  color: #fff;
  border: 1px solid transparent;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 400px;
  margin: 0.5rem 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.action-button.offer-now-button {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    background: #E1E6EB;
    color: #0A0C0F;
    text-shadow: none;
    padding: 0.75rem 1.5rem;
}

.action-button.offer-now-button:hover:not(:disabled) {
    background: #fff;
    color: #000;
}

.offer-price {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: none;
    letter-spacing: 0px;
}

.offer-action {
    font-size: 1.2rem;
    font-weight: bold;
}

.action-button:hover:not(:disabled) {
  box-shadow: var(--glow-shadow);
  transform: translateY(-2px);
}

.action-button.secondary {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-button.secondary:hover:not(:disabled) {
    background-color: rgba(0, 246, 255, 0.1);
    color: white;
    box-shadow: 0 0 15px rgba(0, 246, 255, 0.5);
}

.action-button:disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.tab-button {
  background: none;
  border: none;
  color: var(--text-secondary-color);
  padding: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  text-shadow: 0 0 5px var(--primary-color);
}

.nft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.nft-item {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.nft-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 246, 255, 0.1) 0%, rgba(0, 246, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.nft-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 246, 255, 0.3);
}

.nft-item:hover::before {
    opacity: 1;
}

.nft-item-large {
    background-color: var(--surface-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
    font-size: 2rem;
    box-shadow: var(--glow-shadow);
}

.nft-quantity {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    background-color: rgba(0,0,0,0.5);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
}

/* Fragment Detail Page Styles */
.back-button {
    background: none;
    border: none;
    color: var(--text-secondary-color);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.back-button:hover {
    color: var(--primary-color);
}

.action-buttons-container {
    margin-top: 2rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Marketplace Styles */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: var(--border-radius-small);
}

.market-table {
    display: flex;
    flex-direction: column;
}

.table-header, .table-row {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr auto;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
}

.table-header {
    color: var(--text-secondary-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table-row {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.table-row:hover {
    background-color: rgba(0, 246, 255, 0.05);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row .action-button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    width: auto;
    margin: 0;
}

.fragment-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fragment-emoji {
    font-size: 1.75rem;
    line-height: 1;
}


/* Modal Styles */
.modal-overlay {
    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-content {
    background: radial-gradient(circle, #151A20 0%, #0A0C0F 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), var(--glow-shadow);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-secondary-color);
    cursor: pointer;
}

.small-text {
    font-size: 0.8rem;
    color: var(--text-secondary-color);
    margin-top: 0.5rem;
}

.hidden {
  display: none;
}

/* Desktop Styles */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  header {
    padding: 1rem 2rem;
  }

  main {
    padding: 2rem;
  }

  .main-nav {
    position: static;
    border: none;
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: auto;
    padding: 0;
  }

  .nav-button {
    flex-grow: 0;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    border-top: none;
    border-bottom: 4px solid transparent;
  }

  .nav-button.active {
    border-top-color: transparent;
    border-bottom-color: var(--primary-color);
  }
}
