/* Mobile Responsive CSS for WB Charity */
/* This file contains additional mobile optimizations */

/* Prevent text scaling on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Improve scrolling on iOS */
body {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* Better touch targets */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.touch-target:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.touch-target:active {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(0.98);
}

/* Mobile-optimized input fields */
.mobile-input {
  font-size: 16px !important; /* Prevent zoom on iOS */
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.mobile-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* Mobile-optimized buttons */
.mobile-btn {
  min-height: 48px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-btn:active {
  transform: scale(0.98);
}

.mobile-btn-primary {
  background: linear-gradient(135deg, #f7d35c 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
}

.mobile-btn-primary:hover {
  box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

.mobile-btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.mobile-btn-secondary:hover {
  background: #e9ecef;
}

/* Hide elements on small screens */
@media (max-width: 480px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Show elements only on mobile */
.show-mobile {
  display: none !important;
}

@media (max-width: 768px) {
  .show-mobile {
    display: block !important;
  }
}

/* Mobile-specific spacing */
@media (max-width: 768px) {
  .mobile-spacing {
    margin: 1rem 0.75rem;
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .mobile-spacing {
    margin: 0.75rem 0.5rem;
    padding: 0.75rem 0.5rem;
  }
}

/* Mobile card component */
.mobile-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

@media (max-width: 768px) {
  .mobile-card {
    border-radius: 8px;
    margin: 0.75rem 0;
    padding: 0.75rem;
  }
}

/* Mobile grid */
.mobile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

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

/* Loading states for mobile */
.mobile-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: #666;
  font-size: 16px;
}

.mobile-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: mobile-spin 1s linear infinite;
  margin-right: 12px;
}

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

/* Mobile-optimized tooltips */
.mobile-tooltip {
  position: relative;
  cursor: pointer;
}

.mobile-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.mobile-tooltip:hover::after,
.mobile-tooltip:focus::after {
  opacity: 1;
  visibility: visible;
}

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

/* High contrast support */
@media (prefers-contrast: high) {
  .mobile-btn-primary {
    background: #000;
    border: 2px solid #000;
  }
  
  .mobile-input {
    border: 2px solid #000;
  }
  
  .mobile-card {
    border: 2px solid #000;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .mobile-card {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
  }
  
  .mobile-input {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
  }
  
  .mobile-btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
  }
}

/* Print styles */
@media print {
  .mobile-btn,
  .touch-target,
  .mobile-loading {
    display: none !important;
  }
  
  .mobile-card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
}