/**
 * HAXFFLE Styles - Matching HAXZ Site Design
 */

:root {
  --primary: #e5273d;
  --primary-dark: #c91f33;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #fbbf24;
  --text-primary: #f9f8d7;
  --text-secondary: rgba(249, 248, 215, 0.7);
  --bg-card: rgba(15, 15, 15, 0.8);
  --bg-card-hover: rgba(20, 20, 20, 0.9);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(229, 39, 61, 0.3);
}

/* Base */
body {
  background: #000;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 20% 20%, rgba(229, 39, 61, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1) rotate(5deg);
  }
}

/* Container */
.haxffle-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8rem 2rem 3rem;
}

/* Header */
.haxffle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.header-content {
  flex: 1;
}

.haxffle-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-emoji {
  font-size: 3rem;
  animation: rotate 3s ease-in-out infinite;
}

@keyframes rotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(10deg); }
}

.haxffle-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.875rem;
  opacity: 0.6;
  margin: 0.5rem 0 0;
}

/* Wallet Section */
#walletSection {
  display: flex;
  align-items: center;
}

.connect-btn {
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(229, 39, 61, 0.2);
}

.connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(229, 39, 61, 0.3);
}

.wallet-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  position: relative;
}

.wallet-address {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.875rem;
  opacity: 0.7;
}

.wallet-points {
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  color: var(--secondary);
  font-size: 1.125rem;
}

.info-btn {
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  color: #ffd700;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.info-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #ffd700;
  transform: translateY(-2px);
}

.claim-points-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.claim-points-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Wallet Modal */
.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 20, 0.6) 100%);
  border: 2px solid #333;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  text-align: left;
}

.wallet-option:hover {
  border-color: rgba(229, 39, 61, 0.5);
  background: linear-gradient(135deg, rgba(229, 39, 61, 0.1) 0%, rgba(20, 20, 20, 0.8) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(229, 39, 61, 0.2);
}

.wallet-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-info {
  flex: 1;
}

.wallet-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #f9f8d7;
}

.wallet-desc {
  font-size: 0.875rem;
  opacity: 0.7;
  color: #f9f8d7;
}

.disconnect-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.disconnect-btn:hover {
  background: rgba(229, 39, 61, 0.2);
  color: var(--primary);
  transform: scale(1.1);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(229, 39, 61, 0.3);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  gap: 1.5rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(229, 39, 61, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  opacity: 0.7;
}

.empty-state p {
  opacity: 0.5;
  font-size: 0.875rem;
}

/* Raffle Grid */
.raffle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

/* Raffle Card */
.raffle-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.raffle-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(229, 39, 61, 0.15);
}

/* Locked State */
.raffle-card.locked {
  filter: grayscale(0.4) brightness(0.7);
  cursor: pointer;
}

.raffle-card.locked:hover {
  filter: grayscale(0.2) brightness(0.9);
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 0, 51, 0.5);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.85));
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.raffle-card.locked:hover .locked-overlay {
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.15), rgba(229, 39, 61, 0.1));
}

.lock-icon {
  font-size: 4rem;
  animation: lockPulse 2s ease-in-out infinite, lockFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 0, 51, 0.5));
}

@keyframes lockPulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes lockFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.raffle-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(229, 39, 61, 0.1), rgba(139, 92, 246, 0.1));
}

.raffle-content {
  padding: 1.5rem;
}

.raffle-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.raffle-type-badge.singularity-badge {
  background: linear-gradient(135deg, rgba(229, 39, 61, 0.2), rgba(255, 0, 51, 0.15));
  border-color: rgba(255, 0, 51, 0.6);
  color: #ff0033;
  animation: singularityPulse 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 0, 51, 0.3);
}

@keyframes singularityPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 0, 51, 0.6);
  }
}

.singularity-exclusive-badge {
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.2), rgba(229, 39, 61, 0.15));
  border: 2px solid rgba(255, 0, 51, 0.5);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ff0033;
  text-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
  animation: singularityGlow 2s ease-in-out infinite;
  font-family: 'Oxanium', sans-serif;
  letter-spacing: 0.1em;
}

@keyframes singularityGlow {
  0%, 100% {
    border-color: rgba(255, 0, 51, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
  }
  50% {
    border-color: rgba(255, 0, 51, 0.8);
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.4);
  }
}

.raffle-card.singularity-exclusive {
  border: 2px solid rgba(255, 0, 51, 0.4);
  box-shadow: 0 0 30px rgba(255, 0, 51, 0.2);
  animation: singularityCardPulse 3s ease-in-out infinite;
}

.raffle-card.singularity-exclusive:hover {
  border-color: rgba(255, 0, 51, 0.7);
  box-shadow: 0 0 50px rgba(255, 0, 51, 0.4);
}

@keyframes singularityCardPulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.2);
  }
  50% {
    box-shadow: 0 0 45px rgba(255, 0, 51, 0.35);
  }
}

.raffle-card-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.raffle-description {
  font-size: 0.875rem;
  opacity: 0.7;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.raffle-meta {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.raffle-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.raffle-meta-label {
  opacity: 0.5;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raffle-meta-value {
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

.countdown {
  color: var(--warning);
}

.countdown.ended {
  color: var(--text-secondary);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  backdrop-filter: blur(20px);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(229, 39, 61, 0.1);
  border-color: var(--primary);
}

/* Raffle Detail */
.raffle-detail-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.raffle-detail-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(229, 39, 61, 0.1), rgba(139, 92, 246, 0.1));
}

.raffle-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.raffle-detail-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.raffle-detail-description {
  opacity: 0.8;
  line-height: 1.5;
  font-size: 0.9375rem;
}

/* Stats */
.raffle-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 0.75rem;
}

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

.stat-label {
  font-size: 0.6875rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.stat-value {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
}

/* Buy Tickets Section */
.buy-tickets-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.buy-tickets-section h3 {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.125rem;
  margin: 0 0 0.875rem;
  text-align: center;
  opacity: 0.8;
}

.ticket-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.ticket-option {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.ticket-option:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.ticket-option-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ticket-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  font-size: 1.25rem;
}

.ticket-icon.points {
  background: linear-gradient(135deg, var(--secondary), #6366f1);
}

.ticket-option-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.ticket-option-price {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8125rem;
  opacity: 0.6;
}

.ticket-input-group {
  margin-bottom: 0.75rem;
  text-align: center;
}

.ticket-input {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Oxanium', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  transition: all 0.3s ease;
  text-align: center;
}

.ticket-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.ticket-input::placeholder {
  font-size: 0.875rem;
  opacity: 0.5;
}

.ticket-preview {
  margin-top: 0.75rem;
  font-family: 'Oxanium', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--secondary);
  text-align: center;
}

.buy-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Oxanium', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(229, 39, 61, 0.3);
}

.buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.buy-btn.points {
  background: linear-gradient(135deg, var(--secondary) 0%, #6366f1 100%);
}

.buy-btn.points:hover {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

/* Winner Badge */
.winner-badge {
  padding: 1.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  text-align: center;
  margin-top: 1rem;
}

.winner-badge h3 {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.5rem;
  color: var(--success);
  margin: 0 0 0.5rem;
}

.winner-address {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 968px) {
  .haxffle-container {
    padding: 6rem 1rem 2rem;
  }

  .haxffle-title {
    font-size: 2.5rem;
  }

  .raffle-grid {
    grid-template-columns: 1fr;
  }

  .raffle-detail-header {
    grid-template-columns: 1fr;
  }

  .ticket-options {
    grid-template-columns: 1fr;
  }

  .raffle-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .haxffle-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }
}

