/**
 * Treasury CSS - Treasury Section Styles
 * 
 * This file contains styles for:
 * - Treasury section layout
 * - Asset cards and grid
 * - Asset icons and overlays
 * - Traits overlay
 * - Treasury total display
 * - Fractionalized and rented badges
 * - Electric border trim (shared utility)
 * 
 * Extracted from index.php during section compartmentalization refactoring
 */

/* ============================================
   Electric Border Trim (Shared Utility)
   ============================================ */
.electric-border-trim {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  pointer-events: none;
  border-radius: 16px;
  border: 3px solid #38dbef;
  filter: url(#turbulent-displace);
  z-index: 2;
  transform: scale(1.01);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  box-sizing: border-box;
}

/* Electric border trim for treasury-total - matches header-content */
.treasury-total-wrapper .electric-border-trim {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  pointer-events: none;
  border-radius: 16px;
  border: 3px solid #38dbef;
  filter: url(#turbulent-displace);
  z-index: 2;
  transform: scale(1.01);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  box-sizing: border-box;
}

.header-content, .treasury-total, .preview-overlay {
  position: relative;
  overflow: visible;
}

/* ============================================
   Treasury Section
   ============================================ */
.treasury { 
  margin-top: clamp(60px, 8vw, 100px);
  margin-bottom: 0;
  min-height: fit-content;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.treasury h2 { 
  font-size: clamp(1.6em, 4vw, 2em); 
  color: var(--accent); 
  margin-bottom: clamp(8px, 1.5vw, 10px); 
  text-align: center; 
}

.treasury-intro {
  text-align: center;
  color: #ccc;
  font-size: clamp(0.95em, 2.5vw, 1.1em);
  margin-top: clamp(25px, 4vw, 40px);
  margin-bottom: clamp(25px, 4vw, 40px);
  padding: 0 clamp(10px, 2vw, 20px);
}

/* ============================================
   Treasury Grid
   ============================================ */
.treasury-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(20px, 3vw, 30px);
  margin-bottom: clamp(30px, 4vw, 50px);
}

@media (max-width: 768px) {
  .treasury-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ============================================
   Asset Cards
   ============================================ */
.asset-card {
  background: rgba(19,26,34,0.92);
  padding: clamp(20px, 3vw, 30px);
  border-radius: clamp(12px, 1.5vw, 16px);
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 16px #000;
  backdrop-filter: blur(2px);
  transform: scale(0.85);
  transform-origin: top center;
}

@media (max-width: 768px) {
  .asset-card {
    transform: scale(1);
  }
}

.asset-card .card-content {
  transition: filter 0.3s ease;
}

.asset-card:hover .card-content {
  filter: blur(4px);
}

.asset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--credit));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.asset-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(63,224,249,0.15);
  border-color: rgba(63,224,249,0.3);
}

.asset-card:hover::before {
  transform: scaleX(1);
}

/* ============================================
   Asset Icon
   ============================================ */
.asset-icon {
  width: clamp(150px, 25vw, 200px);
  height: clamp(150px, 25vw, 200px);
  margin: 0 auto clamp(15px, 2.5vw, 20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffd700;
  border: clamp(3px, 0.5vw, 4px) solid var(--accent);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.asset-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ============================================
   Asset Info
   ============================================ */
.asset-card h3 {
  color: var(--accent);
  font-size: clamp(1.1em, 3vw, 1.3em);
  margin-bottom: clamp(12px, 2.5vw, 18px);
  text-align: center;
}

.asset-amount {
  color: #fff;
  font-size: clamp(1.2em, 3.5vw, 1.4em);
  font-weight: bold;
  text-align: center;
  margin-bottom: clamp(10px, 2vw, 15px);
}

.asset-value {
  color: var(--credit);
  font-size: clamp(1em, 2.5vw, 1.1em);
  font-weight: bold;
  text-align: center;
  margin-bottom: clamp(12px, 2.5vw, 18px);
}

.asset-description {
  color: #ccc;
  font-size: clamp(0.85em, 2vw, 0.9em);
  line-height: 1.5;
  text-align: center;
  margin: 0;
}

/* ============================================
   Traits Overlay
   ============================================ */
.asset-card .traits-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(19, 26, 34, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  padding: 20px;
  text-align: center;
}

.asset-card:hover .traits-overlay {
  opacity: 1;
}

.traits-title {
  font-size: 1.5em;
  color: #ffe154;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 225, 84, 0.5);
}

.trait-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 200px;
  margin: 5px 0;
  padding: 5px 0;
  border-bottom: 1px solid rgba(63, 224, 249, 0.3);
}

.trait-label {
  color: #3fe0f9;
  font-weight: bold;
}

.trait-value {
  color: white;
}

/* ============================================
   Treasury Total Wrapper
   ============================================ */
.treasury-total-wrapper {
  position: relative;
  margin: 0 auto;
  max-width: 98%; /* Changed from 1000px to prevent overflow */
  width: calc(98% - clamp(20px, 5vw, 40px));
  overflow: visible;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .treasury-total-wrapper {
    width: calc(100% - 24px);
  }
}

/* ============================================
   Treasury Total
   ============================================ */
.treasury-total {
  position: relative;
  padding: clamp(15px, 2.5vw, 20px) clamp(12px, 2vw, 16px);
  margin: 0 auto;
  background: linear-gradient(180deg, 
    rgba(63,224,249,0.03) 0%,
    rgba(17,17,17,0.5) 50%,
    rgba(63,224,249,0.03) 100%
  );
  border: clamp(2px, 0.3vw, 3px) solid #43dfeb;
  border-radius: clamp(12px, 1.5vw, 16px);
  backdrop-filter: blur(5px);
  box-shadow: 0 0 24px rgba(146,151,155,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  overflow: hidden;
}

.treasury-total::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(63,224,249,0.03) 10px,
    rgba(63,224,249,0.03) 20px
  );
  animation: treasury-shimmer 20s linear infinite;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

@keyframes treasury-shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(360deg); }
}

.treasury-total h3 {
  color: var(--accent);
  font-size: clamp(1.3em, 3.5vw, 1.6em);
  margin: 0 0 clamp(12px, 2.5vw, 18px) 0;
  position: relative;
  z-index: 1;
}

.total-amount {
  color: var(--credit);
  font-size: clamp(1.8em, 5vw, 2.2em);
  font-weight: bold;
  margin: 0 0 clamp(12px, 2.5vw, 18px) 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 10px rgba(255,225,84,0.5);
  word-break: break-word;
}

.last-updated {
  color: #ccc;
  font-size: clamp(0.8em, 2vw, 0.9em);
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ============================================
   Badges
   ============================================ */
.fractionalized-badge {
  position: absolute;
  top: clamp(10px, 2vw, 15px);
  right: clamp(10px, 2vw, 15px);
  background: rgba(255, 225, 84, 0.9);
  color: #000;
  font-size: clamp(0.75em, 2vw, 0.85em);
  font-weight: 900;
  padding: clamp(5px, 1vw, 6px) clamp(10px, 2vw, 12px);
  border-radius: clamp(8px, 1.5vw, 12px);
  border: clamp(1.5px, 0.25vw, 2px) solid #fff;
  text-shadow: none;
  box-shadow: 
    0 0 10px rgba(255, 225, 84, 0.8),
    0 0 20px rgba(255, 225, 84, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: fractionalized-glow 2s ease-in-out infinite alternate;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes fractionalized-glow {
  from {
    box-shadow: 
      0 0 10px rgba(255, 225, 84, 0.8),
      0 0 20px rgba(255, 225, 84, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1);
  }
  to {
    box-shadow: 
      0 0 15px rgba(255, 225, 84, 1),
      0 0 30px rgba(255, 225, 84, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
  }
}

.rented-badge {
  position: absolute;
  top: clamp(10px, 2vw, 15px);
  right: clamp(10px, 2vw, 15px);
  background: rgba(255, 225, 84, 0.9);
  color: #000;
  font-size: clamp(0.75em, 2vw, 0.85em);
  font-weight: 900;
  padding: clamp(5px, 1vw, 6px) clamp(10px, 2vw, 12px);
  border-radius: clamp(8px, 1.5vw, 12px);
  border: clamp(1.5px, 0.25vw, 2px) solid #fff;
  text-shadow: none;
  box-shadow: 
    0 0 10px rgba(255, 225, 84, 0.8),
    0 0 20px rgba(255, 225, 84, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: rented-glow 2s ease-in-out infinite alternate;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes rented-glow {
  from {
    box-shadow: 
      0 0 10px rgba(255, 225, 84, 0.8),
      0 0 20px rgba(255, 225, 84, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1);
  }
  to {
    box-shadow: 
      0 0 15px rgba(255, 225, 84, 1),
      0 0 30px rgba(255, 225, 84, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
  }
}

/* ============================================
   Section Divider
   ============================================ */
.section-divider {
  content: '';
  position: relative;
  display: block;
  width: min(360px, 90vw); /* Responsive width to prevent overflow */
  height: 2px;
  background: #38dbef;
  margin: clamp(30px, 4vw, 50px) auto 0;
  border-radius: 1px;
  box-shadow: 0 0 12px rgba(56, 219, 239, 0.6),
              0 0 6px rgba(56, 219, 239, 0.4),
              0 0 3px rgba(56, 219, 239, 0.3);
}

@media (max-width: 768px) {
  .treasury-total {
    padding: 15px 12px;
  }

  .section-divider {
    width: min(300px, 85vw); /* Responsive width to prevent overflow */
    margin: clamp(30px, 5vw, 50px) auto;
  }
}

