/*
 * Wallet Authentication System Styles
 * Reusable CSS for loading screen and wallet authentication UI
 */

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* CSS Variables for easy customization - Match dashboard styling */
:root {
  /* Colors - Match dashboard design */
  --primary-color: #0088fe;
  --secondary-color: #ffffff;
  --background-dark: rgba(5, 10, 20, 0.95);
  --background-card: rgba(10, 15, 25, 0.9);
  --border-color: rgba(0, 136, 254, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #a8b2d1;
  --success-color: #0088fe;
  --error-color: #ef4444;
  
  /* Fonts - Match dashboard */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Montserrat', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Loading Screen Styles */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--background-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow: hidden;
}

.loading-video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.loading-video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1px) brightness(0.6) contrast(1.1);
}

.loading-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(0, 136, 254, 0.15) 0%, 
    rgba(0, 136, 254, 0.1) 50%, 
    rgba(0, 0, 0, 0.3) 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
  z-index: 2;
  animation: loading-overlay-pulse 3s ease-in-out infinite alternate;
}

@keyframes loading-overlay-pulse {
  0% { opacity: 0.6; }
  100% { opacity: 0.9; }
}

.loading-container {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: var(--spacing-xl);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

.blood-drop-loader {
  margin-bottom: var(--spacing-lg);
  position: relative;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.blood-drop {
  width: 12px;
  height: 12px;
  background: var(--primary-color);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  margin: 0 4px;
  animation: blood-drop-bounce 1.4s infinite ease-in-out;
}

.blood-drop:nth-child(1) { animation-delay: -0.32s; }
.blood-drop:nth-child(2) { animation-delay: -0.16s; }
.blood-drop:nth-child(3) { animation-delay: 0s; }

@keyframes blood-drop-bounce {
  0%, 80%, 100% {
    transform: rotate(45deg) scale(0);
  }
  40% {
    transform: rotate(45deg) scale(1);
  }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 20px rgba(0, 136, 254, 0.5);
  animation: loading-glow 2s ease-in-out infinite alternate;
  letter-spacing: 0.1em;
}

.loading-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  font-weight: 300;
}

.loading-progress {
  margin-bottom: var(--spacing-md);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #ff6666);
  border-radius: 2px;
  width: 0%;
  transition: width var(--transition-fast);
  animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% { box-shadow: 0 0 5px rgba(0, 136, 254, 0.5); }
  50% { box-shadow: 0 0 20px rgba(0, 136, 254, 0.8); }
  100% { box-shadow: 0 0 5px rgba(0, 136, 254, 0.5); }
}

@keyframes loading-glow {
  0% { text-shadow: 0 0 20px rgba(0, 136, 254, 0.5); }
  100% { text-shadow: 0 0 30px rgba(0, 136, 254, 0.8); }
}

.loading-percentage {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fade-out {
  opacity: 0;
  transition: opacity 1s ease-out;
}

/* Authentication Screen Styles */
.auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--background-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.auth-screen.hidden {
  display: none;
}

.auth-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 136, 254, 0.1) 0%, rgba(0, 0, 0, 0.9) 70%);
  animation: backdrop-pulse 4s ease-in-out infinite alternate;
}

@keyframes backdrop-pulse {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

.auth-container {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, rgba(10, 15, 25, 0.95) 0%, rgba(15, 20, 35, 0.9) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 136, 254, 0.3);
  border-radius: 16px;
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 90%;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 136, 254, 0.15),
    inset 0 1px 0 rgba(0, 136, 254, 0.1);
  animation: auth-float-in 0.8s ease-out;
}

@keyframes auth-float-in {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(0, 136, 254, 0.6));
  transition: all 0.3s ease;
  animation: logo-glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes logo-glow-pulse {
  0% { 
    filter: drop-shadow(0 0 15px rgba(0, 136, 254, 0.6));
    transform: scale(1);
  }
  100% { 
    filter: drop-shadow(0 0 25px rgba(0, 136, 254, 0.9));
    transform: scale(1.05);
  }
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  text-align: center;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.auth-body {
  margin-bottom: var(--spacing-lg);
}

.wallet-grid {
  display: grid;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.wallet-card {
  background: linear-gradient(135deg, rgba(15, 20, 35, 0.8) 0%, rgba(10, 15, 25, 0.9) 100%);
  border: 1px solid rgba(0, 136, 254, 0.2);
  border-radius: 12px;
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 136, 254, 0.05);
}

.wallet-card:hover {
  border-color: rgba(0, 136, 254, 0.4);
  background: linear-gradient(135deg, rgba(20, 25, 40, 0.9) 0%, rgba(15, 20, 35, 0.95) 100%);
  transform: translateY(-4px);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(0, 136, 254, 0.15),
    inset 0 1px 0 rgba(0, 136, 254, 0.1);
}

.wallet-card:active {
  transform: translateY(0);
}

.wallet-card-inner {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.wallet-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.wallet-info {
  flex: 1;
  min-width: 0;
}

.wallet-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wallet-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.connect-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(0, 136, 254, 0.1);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 136, 254, 0.2);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-display);
}

.wallet-card:hover .connect-text {
  background: linear-gradient(135deg, var(--primary-color), rgba(0, 136, 254, 0.8));
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 136, 254, 0.3);
}

.auth-footer {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.auth-disclaimer {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Main Content Styles */
.main-content {
  min-height: 100vh;
  background: var(--background-dark);
}

.main-content.hidden {
  display: none;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .loading-container {
    padding: var(--spacing-lg);
    margin: var(--spacing-md);
  }
  
  .loading-text {
    font-size: 2rem;
  }
  
  .auth-container {
    padding: var(--spacing-lg);
    margin: var(--spacing-md);
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .wallet-card-inner {
    gap: var(--spacing-sm);
  }
  
  .wallet-icon {
    width: 40px;
    height: 40px;
  }
  
  .loading-video-background video {
    filter: blur(1px) brightness(0.7) contrast(1.1);
  }
}

@media (max-width: 480px) {
  .loading-text {
    font-size: 1.8rem;
  }
  
  .auth-title {
    font-size: 1.3rem;
  }
  
  .wallet-name {
    font-size: 1rem;
  }
  
  .wallet-desc {
    font-size: 0.8rem;
  }
}
