/* Custom Styles for Vannin OS */

/* Hide scrollbar for horizontal tabs */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile-optimized buttons */
@media (max-width: 768px) {
  .tab-btn {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
  
  .btn-icon-only {
    padding: 0.75rem;
  }
}

/* Smooth transitions */
.transition-all {
  transition: all 0.3s ease;
}

/* Loading spinner */
.loading {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Bottom navigation bar for mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem 0;
  z-index: 40;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

/* Pulse animation for live updates */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Toast notification position */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 90%;
}

@media (max-width: 640px) {
  .toast {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* Modal improvements for mobile */
.modal {
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .modal {
    margin: 0.5rem;
    max-height: 95vh;
  }
}

/* Safe area insets for mobile devices */
@supports (padding: max(0px)) {
  .safe-area-bottom {
    padding-bottom: max(env(safe-area-inset-bottom), 1rem);
  }
  
  .safe-area-top {
    padding-top: max(env(safe-area-inset-top), 1rem);
  }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Touch-friendly tap areas */
.tap-area {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Improved focus states for accessibility */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

button:focus,
a:focus {
  outline-color: #2563eb;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .auto-dark {
    background-color: #1f2937;
    color: #f9fafb;
  }
}

/* Animation for pull to refresh */
.refresh-indicator {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.refresh-indicator.visible {
  transform: translateY(0);
}

/* Improved card shadows */
.card-shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Responsive text sizes */
.text-responsive {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.text-responsive-lg {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.text-responsive-xl {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

/* Grid improvements for mobile */
@media (max-width: 640px) {
  .grid-responsive {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  z-index: 30;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.fab:active {
  transform: scale(0.95);
}

/* Status badge colors */
.status-due {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-arriving {
  background-color: #fed7aa;
  color: #9a3412;
}

.status-soon {
  background-color: #fef3c7;
  color: #92400e;
}

.status-ontime {
  background-color: #d1fae5;
  color: #065f46;
}
