/**
 * Mobile-friendly authentication overlay styles
 */

.xaman-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.auth-container {
  position: relative;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: authSlideIn 0.3s ease-out;
}

.auth-container.mobile {
  width: 95%;
  max-width: 380px;
  border-radius: 16px;
}

@keyframes authSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.auth-container.mobile .auth-header {
  padding: 20px;
  border-radius: 16px 16px 0 0;
}

.auth-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.auth-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.auth-content {
  padding: 24px;
}

.auth-container.mobile .auth-content {
  padding: 20px;
}

/* Mobile app button */
.auth-mobile-action {
  margin-bottom: 24px;
}

.xaman-app-button {
  display: flex;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.xaman-app-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  color: white;
  text-decoration: none;
}

.app-button-icon {
  font-size: 32px;
  margin-right: 16px;
}

.app-button-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.app-button-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* Divider */
.auth-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.auth-divider span {
  background: white;
  padding: 0 16px;
  font-size: 12px;
  color: #999;
  position: relative;
}

/* QR Code section */
.auth-qr-section {
  text-align: center;
  margin-bottom: 24px;
}

.auth-qr-code {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}

.auth-qr-instructions {
  color: #666;
  font-size: 14px;
  margin: 12px 0;
}

.xaman-desktop-link {
  display: inline-block;
  color: #4CAF50;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #4CAF50;
  border-radius: 8px;
  transition: all 0.2s;
}

.xaman-desktop-link:hover {
  background: #4CAF50;
  color: white;
  text-decoration: none;
}

/* Status section */
.auth-status {
  text-align: center;
  margin-bottom: 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-waiting, .auth-success, .auth-cancelled, .auth-error {
  padding: 16px;
  border-radius: 12px;
}

.auth-waiting {
  background: #f0f8ff;
  border: 1px solid #cce7ff;
}

.auth-success {
  background: #f0fff4;
  border: 1px solid #b3ffcc;
}

.auth-cancelled {
  background: #fff8f0;
  border: 1px solid #ffcc99;
}

.auth-error {
  background: #fff5f5;
  border: 1px solid #ffcccc;
}

.auth-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-message {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.auth-details {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.auth-address {
  font-size: 14px;
  color: #4CAF50;
  font-family: 'Monaco', 'Menlo', monospace;
  background: rgba(76, 175, 80, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.auth-checks {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.retry-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.retry-btn:hover {
  background: #e55a2b;
}

/* Loading spinner */
.auth-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-container {
    width: 95%;
    max-height: 85vh;
  }
  
  .auth-header {
    padding: 16px;
  }
  
  .auth-content {
    padding: 16px;
  }
  
  .auth-qr-code {
    width: 180px !important;
    height: 180px !important;
  }
  
  .app-button-icon {
    font-size: 28px;
    margin-right: 12px;
  }
  
  .app-button-title {
    font-size: 16px;
  }
  
  .app-button-subtitle {
    font-size: 13px;
  }
}

@media (max-height: 640px) {
  .auth-container {
    max-height: 95vh;
  }
  
  .auth-qr-code {
    width: 160px !important;
    height: 160px !important;
  }
  
  .auth-content {
    padding: 16px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .auth-container {
    background: #1a1a1a;
    color: #ffffff;
  }
  
  .auth-header {
    border-bottom-color: #333;
  }
  
  .auth-divider::before {
    background: #333;
  }
  
  .auth-divider span {
    background: #1a1a1a;
    color: #999;
  }
  
  .auth-qr-code {
    border-color: #333;
  }
  
  .auth-waiting {
    background: #1a2332;
    border-color: #2d4a66;
    color: #ffffff;
  }
  
  .auth-success {
    background: #1a2e1a;
    border-color: #2d5a2d;
    color: #ffffff;
  }
  
  .auth-cancelled {
    background: #332a1a;
    border-color: #664a2d;
    color: #ffffff;
  }
  
  .auth-error {
    background: #331a1a;
    border-color: #662d2d;
    color: #ffffff;
  }
  
  .auth-message {
    color: #ffffff;
  }
}