/* YTScheduler Pro - Mobile Responsive Styles */

/* Base reset and improvements */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #f9f9f9;
  color: #0f0f0f;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar for clean UI */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile-friendly touch targets */
button,
a,
input,
select,
textarea {
  min-height: 44px;
  font-size: 16px;
  /* Prevents zoom on iOS */
}

/* Input focus styles */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Tables - responsive on mobile */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    white-space: nowrap;
    padding: 8px 12px !important;
  }
}

/* Card/Panel responsive padding */
@media (max-width: 640px) {

  .card,
  .panel,
  [class*="rounded-lg"][class*="bg-white"] {
    border-radius: 0.5rem;
    padding: 1rem;
  }
}

/* Grid responsive adjustments */
@media (max-width: 640px) {
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Flex wrap on mobile */
@media (max-width: 640px) {
  .flex-row:not(.flex-nowrap) {
    flex-wrap: wrap;
  }

  .gap-4 {
    gap: 0.75rem;
  }

  .gap-6 {
    gap: 1rem;
  }

  .gap-8 {
    gap: 1.25rem;
  }
}

/* Typography responsive */
@media (max-width: 640px) {

  h1,
  .text-3xl,
  .text-4xl {
    font-size: 1.5rem !important;
  }

  h2,
  .text-2xl {
    font-size: 1.25rem !important;
  }

  h3,
  .text-xl {
    font-size: 1.125rem !important;
  }

  .text-lg {
    font-size: 1rem !important;
  }
}

/* Modal responsive */
@media (max-width: 640px) {
  [class*="fixed"][class*="inset-0"] [class*="max-w-"] {
    max-width: 95% !important;
    margin: 1rem;
  }
}

/* Button groups on mobile - stack vertically */
@media (max-width: 480px) {

  .flex.gap-2:has(button),
  .flex.gap-3:has(button) {
    flex-direction: column;
    align-items: stretch;
  }

  .flex.gap-2:has(button) button,
  .flex.gap-3:has(button) button {
    width: 100%;
    justify-content: center;
  }
}

/* Form inputs full width on mobile */
@media (max-width: 640px) {

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="url"],
  select,
  textarea {
    width: 100%;
    max-width: 100%;
  }
}

/* Image responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Video preview responsive */
video {
  max-width: 100%;
  height: auto;
}

/* Hide on mobile / desktop utilities */
@media (max-width: 1023px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Safe area insets for iOS notch */
@supports (padding: max(0px)) {
  .safe-area-inset {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #ef4444;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Smooth transitions */
.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state for mobile touch */
@media (hover: none) {

  button:active,
  a:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* Pull to refresh prevention */
body {
  overscroll-behavior-y: contain;
}

/* Fix for 100vh on mobile browsers */
.h-screen {
  height: 100vh;
  height: 100dvh;
}

/* Analysis Core Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* Gradient text for headings */
.gradient-text {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Analysis card styling */
.analysis-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.95) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: all 0.3s ease;
}

.analysis-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.1);
}

/* Copy button hover effect */
.copy-btn {
  transition: all 0.2s ease;
}

.copy-btn:hover {
  transform: scale(1.1);
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Loading shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}