/* Mobile-specific enhancements */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
  /* Ensure all interactive elements are at least 44px */
  .btn, button, a, input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improved form elements */
  select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
  }
  
  /* Loading states */
  .btn.loading {
    position: relative;
    color: transparent;
  }
  
  .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    color: white;
  }
  
  @keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }
  
  /* Swipe indicators */
  .swipeable::after {
    content: '←→ Swipe for more';
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
  }
  
  /* Improved pagination for mobile */
  .pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .pagination a,
  .pagination span {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 500;
  }
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d8f3f;
  color: white;
  padding: 1rem 2rem;
  border-radius: 0 0 20px 20px;
  font-size: 0.9rem;
  z-index: 1000;
  transition: top 0.3s ease;
}

.pull-to-refresh.active {
  top: 0;
}

/* Floating action button for mobile */
@media (max-width: 768px) {
  .floating-action-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #2d8f3f;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(45, 143, 63, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
  }
  
  .floating-action-btn:hover,
  .floating-action-btn:active {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(45, 143, 63, 0.6);
  }
  
  /* Hide floating button when keyboard is open */
  .keyboard-open .floating-action-btn {
    display: none;
  }
}

/* Improved modal/popup for mobile */
@media (max-width: 768px) {
  .modal {
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
    max-height: none;
  }
  
  .modal-content {
    height: 100%;
    overflow-y: auto;
    padding: 2rem 1rem;
  }
  
  .modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 1rem;
  }
}

/* Dark mode support for mobile */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .navbar {
    background: #1a1a1a;
    border-bottom-color: #333;
  }
  
  .nav-links {
    background: #1a1a1a;
  }
  
  .nav-links a {
    color: #e5e5e5;
  }
  
  .nav-links a:hover {
    background: #333;
    color: #2d8f3f;
  }
}
