/* PFPMXR Mobile-First "Crisp & Minimal" Design */

/* CSS Reset & Mobile-First Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-First: Design for smallest screen first */
.mobile-body, body {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%) !important;
  color: #ffffff !important;
  font-size: 14px; /* Optimized for mobile readability */
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Force dark theme on ALL elements - CRITICAL FIX */
.mobile-body *, body *, * {
  background-color: transparent !important;
  color: #ffffff !important;
}

/* Specific fixes for white text issues */
input, textarea, select {
  background: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
  border: 2px solid #3b82f6 !important;
}

.text-area, .input-field, .form-control {
  background: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
}

/* Fix for white boxes and containers */
.card, .container, .form-group, .input-group {
  background: transparent !important;
  color: #ffffff !important;
}

/* Override any white backgrounds */
[style*="background-color: white"], 
[style*="background-color: #fff"],
[style*="background-color: #ffffff"] {
  background-color: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
}

/* Critical fix for white containers */
.white-box, .bg-white, .background-white {
  background-color: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
}

/* Fix for any element with white background inline styles */
div[style*="background"], 
section[style*="background"],
.container[style*="background"] {
  background-color: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
}

/* Ensure dark mode is applied to all text */
h1, h2, h3, h4, h5, h6, p, span, div, label {
  color: #ffffff !important;
}

/* Make sure buttons are visible */
button {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
  border: none !important;
}

button:disabled {
  background-color: #666666 !important;
  color: #cccccc !important;
}

/* Container & Layout - Mobile First */
.container {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  margin: 0 auto;
}

/* Desktop containers */
@media (min-width: 768px) {
  .container {
    max-width: 1200px;
    padding: 2rem;
  }
}

/* Navigation - Mobile Optimized */
nav {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem !important;
  min-height: 48px !important;
}

/* Logo & Brand */
.nav-brand, .brand-link {
  display: flex;
  align-items: center;
  font-size: 1.1rem !important;
  font-weight: 700;
  color: #3b82f6 !important;
  text-decoration: none;
}

.brand-icon {
  margin-right: 0.5rem;
  font-size: 1.2rem !important;
  color: #3b82f6 !important;
}

.brand-text {
  color: #ffffff !important;
  font-size: 0.9rem !important;
}

/* User Info Section */
.user-info-section {
  display: none;
}

.user-info-content {
  text-align: center;
  padding: 0.5rem;
}

.user-nickname {
  font-size: 0.9rem !important;
  font-weight: 600;
  color: #ffffff !important;
  margin-bottom: 0.25rem;
}

.user-location {
  font-size: 0.75rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Wallet Section */
.wallet-section {
  margin-top: 1rem;
}

.wallet-connect-btn, .connected-wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem !important;
  font-weight: 500;
  min-height: 44px;
  border: 1px solid #3b82f6;
  color: #3b82f6 !important;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wallet-connect-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #ffffff !important;
}

/* Navigation Links - Mobile Stack */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  padding: 1rem;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-links.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Desktop Navigation */
@media (min-width: 768px) {
  .nav-links {
    position: static;
    flex-direction: row;
    gap: 2rem;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: none;
    padding: 0;
  }
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
  text-align: center;
  min-height: 44px; /* iOS minimum touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: block;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Buttons - Mobile Optimized */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-height: 48px; /* Mobile touch target */
  min-width: 48px;
  line-height: 1.2;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Cards - Mobile First */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Typography - Mobile Optimized */
h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  text-align: center;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

/* MOBILE-FIRST: Ultra-compact typography */
h1, .hero-title {
  font-size: 1.2rem !important;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h2, .section-title {
  font-size: 1rem !important;
  font-weight: 600;
  color: #ffffff !important;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h3, .page-title, .tier-card h4 {
  font-size: 0.9rem !important;
  font-weight: 600;
  color: #ffffff !important;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

p, .hero-subtitle, .section-description {
  font-size: 0.75rem !important;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8) !important;
  margin-bottom: 0.5rem;
}

/* Buttons - Mobile compact */
.btn, button {
  font-size: 0.8rem !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.4rem !important;
  font-weight: 500;
  min-height: 36px !important;
}

/* Desktop Typography */
@media (min-width: 768px) {
  h1, .hero-title {
    font-size: 2.5rem !important;
  }
  
  h2, .section-title {
    font-size: 1.75rem !important;
  }
  
  h3, .page-title {
    font-size: 1.5rem !important;
  }
  
  p, .hero-subtitle, .section-description {
    font-size: 1rem !important;
  }
}

/* Grid - Mobile First */
.grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Mobile: Single column */
.grid-cols-1 {
  grid-template-columns: 1fr;
}

/* Tablet: Two columns */
@media (min-width: 768px) {
  .grid-cols-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: Multiple columns */
@media (min-width: 1024px) {
  .grid-cols-lg-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Spacing Utilities */
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Section Styling - Ultra Compact Mobile */
.cta-section, .features-section, .pricing-section, .preview-section {
  background: transparent !important;
  padding: 0.75rem 0.5rem !important;
  margin-bottom: 1rem !important;
}

.cta-content, .section-content {
  max-width: 100%;
  margin: 0 auto;
  background: transparent !important;
}

.cta-description {
  font-size: 0.75rem !important;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8) !important;
  margin-bottom: 1rem !important;
  text-align: center;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem !important;
  align-items: center;
}

/* Tier cards - much more compact */
.tier-card, .pricing-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem !important;
  margin-bottom: 0.5rem !important;
  text-align: center;
}

/* Preview items and images */
.preview-item {
  text-align: center;
  margin-bottom: 1rem;
}

.preview-avatar {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.5rem auto;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.preview-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.preview-title {
  font-size: 0.75rem !important;
  font-weight: 600;
  color: #ffffff !important;
  margin-bottom: 0.25rem !important;
}

.preview-description {
  font-size: 0.65rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  line-height: 1.3;
}

.tier-card h4, .pricing-card-title {
  font-size: 0.85rem !important;
  font-weight: 600;
  margin-bottom: 0.25rem !important;
}

.tier-card .text-2xl, .pricing-card-price {
  font-size: 1rem !important;
  font-weight: 700;
  margin-bottom: 0.25rem !important;
}

.tier-card .text-sm, .pricing-card-description {
  font-size: 0.65rem !important;
  line-height: 1.3;
  margin-bottom: 0.25rem !important;
}

.feature-grid, .pricing-grid, .preview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .cta-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Main Layout Components - Force Dark Theme */
.mobile-nav, .nav-container {
  background: rgba(10, 10, 10, 0.95) !important;
  color: #ffffff !important;
}

.main-content {
  background: transparent !important;
  color: #ffffff !important;
  padding: 1rem;
  min-height: calc(100vh - 60px);
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  background: transparent !important;
}

.page-container {
  background: transparent !important;
  color: #ffffff !important;
}

.hero-section {
  background: transparent !important;
  color: #ffffff !important;
  text-align: center;
  padding: 2rem 1rem;
}

.hero-title {
  font-size: 1.75rem !important;
  font-weight: 800;
  color: #ffffff !important;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.8) !important;
  margin-bottom: 2rem;
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.app-container {
  background: transparent !important;
  color: #ffffff !important;
}

/* Override any white backgrounds */
.bg-white {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

/* Fix text colors in cards and sections */
.bg-white * {
  color: #ffffff !important;
}

.text-gray-800, .text-gray-900, .text-gray-600 {
  color: #ffffff !important;
}

.text-gray-500 {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* CRITICAL: Override Tailwind oversized elements */
.text-4xl { font-size: 1.2rem !important; }
.text-3xl { font-size: 1rem !important; }
.text-2xl { font-size: 0.9rem !important; }
.text-xl { font-size: 0.85rem !important; }
.text-lg { font-size: 0.8rem !important; }
.text-base { font-size: 0.75rem !important; }
.text-sm { font-size: 0.7rem !important; }
.text-xs { font-size: 0.65rem !important; }

/* Button sizing overrides */
.px-8 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-6 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-4 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.py-3 { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; }
.py-2 { padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }

/* Margin overrides for compact layout */
.mb-8 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 0.25rem !important; }

/* Modal - Mobile Optimized */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Form Elements - Mobile Optimized */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.form-input, input[type="text"], input[type="email"], textarea {
  width: 100% !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.8rem !important;
  border: 2px solid #3b82f6 !important;
  border-radius: 0.4rem !important;
  background: rgba(10, 10, 10, 0.9) !important;
  color: #ffffff !important;
  transition: all 0.3s ease;
  min-height: 36px !important;
  box-sizing: border-box;
}

.form-input:focus, input:focus, textarea:focus {
  outline: none !important;
  border-color: #60a5fa !important;
  background: rgba(10, 10, 10, 0.95) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.form-input::placeholder, input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.75rem !important;
}

/* Tier Cards - Mobile Stack */
.tier-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .tier-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tier-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tier-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tier-card:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.tier-card.free {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* PFP Preview Grid - Mobile Optimized */
.pfp-preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

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

.pfp-preview-item {
  text-align: center;
}

.pfp-avatar {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(59, 130, 246, 0.3);
  margin: 0 auto 1rem;
  transition: all 0.3s ease;
}

.pfp-avatar:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.pfp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Utility Classes */
.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.space-between { justify-content: space-between; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Touch-Friendly Improvements */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover, .card:hover, .tier-card:hover {
    transform: none;
  }
  
  /* Larger touch targets */
  .btn, .form-input, .nav-link {
    min-height: 48px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  transition: transform 0.3s ease;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Dark Mode Optimizations */
@media (prefers-color-scheme: dark) {
  /* Already optimized for dark mode */
}