/* Edge Browser Layout Fixes - Kawaii-Cyberpunk Edition */
/* Created by Cuserob - Visual Creation & Interface Design 🎨✨ */

/* ========================================
   EDGE BROWSER SPECIFIC FIXES
   ======================================== */

@supports (-ms-ime-align: auto) {
  /* Edge-specific layout fixes */
  
  /* Fix main title centering */
  .hero-title,
  h1.hero-title {
    text-align: center !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }
  
  /* Fix subtitle alignment */
  .hero-subtitle {
    text-align: center !important;
    width: 100% !important;
  }
  
  /* Fix tab navigation layout in Edge */
  .tab-navigation {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  
  .tab-btn {
    flex: 0 1 auto !important;
    min-width: 120px !important;
  }
  
  /* Fix staking tab layout issues */
  .staking-container,
  .tab-content[data-tab="staking"] {
    display: block !important;
    min-height: auto !important;
    padding-top: 2rem !important;
  }
  
  /* Fix excessive spacing in staking tab */
  .staking-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  .energy-signature-section {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  
  /* Fix marketplace tab layout */
  .marketplace-container,
  .tab-content[data-tab="marketplace"] {
    display: block !important;
    padding: 2rem !important;
  }
  
  /* Fix gradient bar positioning */
  .gradient-bar {
    position: relative !important;
    margin: 1rem auto !important;
    width: 90% !important;
    max-width: 600px !important;
  }
  
  /* Fix modal positioning */
  .modal,
  .transaction-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
  }
  
  /* Fix card layouts in Edge - prevent narrow/tall issues */
  .token-card,
  .staking-card,
  .nft-card {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 400px !important;
    max-height: 600px !important;
    width: 100% !important;
    min-width: 280px !important;
    max-width: 400px !important;
    margin: 0 auto !important;
  }
  
  /* Fix token grid in Edge */
  .token-grid,
  .tokens-grid {
    display: -ms-grid !important;
    display: grid !important;
    -ms-grid-columns: 1fr 1fr 1fr !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    justify-items: center !important;
  }
  
  /* Fix card content spacing in Edge */
  .token-card > *,
  .staking-card > *,
  .nft-card > * {
    margin-bottom: auto !important;
  }
  
  .token-card .card-content {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Fix price section in Edge */
  .price-section {
    margin-top: auto !important;
    padding: 1rem !important;
  }
  
  /* Fix button rendering in Edge */
  .btn,
  .button,
  button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
  }
}

/* ========================================
   GENERAL LAYOUT FIXES (ALL BROWSERS)
   ======================================== */

/* Center main title */
.hero-title {
  text-align: center;
  width: 100%;
  margin: 2rem auto;
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, #00ffff, #ff00ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

/* Center subtitle */
.hero-subtitle {
  text-align: center;
  width: 100%;
  margin: 1rem auto 2rem;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   TRANSACTION MODAL FIXES
   ======================================== */

/* Hide transaction modal by default */
.transaction-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 0, 40, 0.95);
  border: 2px solid #ff00ff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 0 40px rgba(255, 0, 255, 0.8);
  z-index: 10000;
  min-width: 300px;
  max-width: 500px;
}

/* Show only when active */
.transaction-modal.active {
  display: block;
  animation: kawaii-pop-in 0.3s ease-out;
}

/* Modal close button */
.transaction-modal .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 2px solid #ff00ff;
  color: #ff00ff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.transaction-modal .close-btn:hover {
  background: #ff00ff;
  color: #0a0015;
  transform: rotate(180deg);
}

/* ========================================
   STAKING TAB LAYOUT FIXES
   ======================================== */

/* Fix staking container spacing */
.staking-container {
  padding: 2rem;
  min-height: 600px;
}

/* Energy signature section */
.energy-signature-section {
  background: rgba(30, 0, 60, 0.6);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 800px;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* Gradient bar styling */
.gradient-bar {
  height: 8px;
  background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00);
  border-radius: 10px;
  margin: 1.5rem auto;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
  animation: kawaii-glow 2s ease-in-out infinite;
}

/* Energy flow calculator */
.energy-flow-calculator {
  background: rgba(40, 0, 80, 0.8);
  border: 2px solid #00ffff;
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 600px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

/* ========================================
   MARKETPLACE TAB KAWAII-CYBERPUNK REDESIGN
   ======================================== */

/* Marketplace container */
.marketplace-container {
  padding: 2rem;
  min-height: 600px;
  background: radial-gradient(circle at center, rgba(255, 0, 255, 0.1), transparent);
}

/* NFT collection tabs */
.marketplace-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.marketplace-tab-btn {
  background: rgba(30, 0, 60, 0.8);
  border: 2px solid #ff00ff;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.marketplace-tab-btn:hover {
  background: #ff00ff;
  color: #0a0015;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 0, 255, 0.6);
}

.marketplace-tab-btn.active {
  background: linear-gradient(135deg, #00ffff, #ff00ff);
  color: #0a0015;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

/* NFT Cards kawaii-cyberpunk style */
.nft-card {
  background: rgba(20, 0, 40, 0.9);
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #00ffff, #ff00ff) 1;
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nft-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 0, 255, 0.2), transparent);
  animation: kawaii-rotate 10s linear infinite;
  pointer-events: none;
}

.nft-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(255, 0, 255, 0.6);
}

/* 3D View placeholder */
.view-3d-placeholder {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
  border: 2px dashed #ff00ff;
  border-radius: 15px;
  padding: 3rem;
  text-align: center;
  color: #ff00ff;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.view-3d-placeholder::after {
  content: '✨ 3D Magic Coming Soon ✨';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  animation: kawaii-pulse 2s ease-in-out infinite;
}

/* Marketplace locked state */
.marketplace-locked {
  position: relative;
  filter: brightness(0.6);
  pointer-events: none;
}

.marketplace-locked::after {
  content: '🔒 Unlocks in Round 3 🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #ff00ff;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
  background: rgba(10, 0, 20, 0.9);
  padding: 2rem 3rem;
  border-radius: 20px;
  border: 3px solid #ff00ff;
  animation: kawaii-glow 2s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes kawaii-pop-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes kawaii-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
}

@keyframes kawaii-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes kawaii-pulse {
  0%, 100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* ========================================
   RESPONSIVE FIXES
   ======================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .tab-navigation {
    padding: 0 1rem;
  }
  
  .marketplace-tabs {
    gap: 0.5rem;
  }
  
  .marketplace-tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.kawaii-hidden {
  display: none !important;
}

.kawaii-visible {
  display: block !important;
}

.cyberpunk-border {
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #00ffff, #ff00ff) 1;
}

.neon-glow {
  box-shadow: 0 0 20px currentColor;
}