/* Mobile and responsive improvements */

:root {
  --mobile-padding: 1rem;
  --mobile-gap: 0.75rem;
}

/* Ensure video element displays properly */
video {
  display: block;
  max-width: 100%;
  height: auto;
  width: 100%;
  object-fit: cover;
}

/* Mobile viewport settings */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  /* Text scaling for mobile */
  h1 {
    font-size: 1.75rem !important;
    line-height: 2rem !important;
    margin-bottom: 1rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
    line-height: 1.75rem !important;
  }

  /* Improve padding on mobile */
  .p-4 {
    padding: 0.75rem !important;
  }

  .p-6 {
    padding: 1rem !important;
  }

  .px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Improve gap spacing on mobile */
  .gap-6 {
    gap: 1rem !important;
  }

  .gap-4 {
    gap: 0.75rem !important;
  }

  /* Ensure video container takes full width with proper aspect ratio */
  video {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 250px;
  }

  /* Make buttons and interactive elements touch-friendly */
  button,
  [role="button"],
  input,
  select,
  textarea {
    min-height: 44px;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    position: relative !important;
  }

  /* Keep buttons within container */
  .flex > button,
  .flex > [role="button"] {
    flex: 1;
    max-width: calc(50% - 0.25rem);
    position: static !important;
    margin: auto !important;
  }

  /* Adjust max-width containers */
  .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }

  .max-w-md {
    max-width: 100% !important;
  }

  /* Flexible flex containers */
  .flex-col {
    gap: 0.75rem !important;
  }

  /* Button container wrapper */
  .flex.flex-col.md\\:flex-row {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .flex.flex-col.md\\:flex-row > button {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Improve text readability */
  p {
    line-height: 1.6;
  }
}

/* Tablet and medium screens */
@media (min-width: 641px) and (max-width: 1024px) {
  h1 {
    font-size: 2.5rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }

  video {
    max-width: 90%;
    margin: 0 auto;
  }
}

/* Large screens */
@media (min-width: 1025px) {
  video {
    max-width: 600px;
  }
}

/* Ensure containers are responsive */
.container,
[class*="max-w-"] {
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--mobile-padding);
  padding-right: var(--mobile-padding);
}

/* Fix overflow issues on smaller screens */
body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* Video element improvements */
video::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Touch-friendly spacing */
@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input,
  select,
  textarea {
    padding: 1rem;
  }
}

/* Optimize for different orientations */
@media (orientation: landscape) and (max-height: 600px) {
  body {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  video {
    max-height: 300px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Thinner lines and borders on high DPI displays */
  border {
    border-width: 0.5px;
  }
}
