/* Pesona Wifi ACS Panel - Responsive UI Enhancement */

:root {
  color-scheme: light dark;
  --acs-accent: #5378f5;
  --acs-accent-hover: #4164e5;
  --acs-radius: 14px;
  --acs-transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a,
input,
select,
textarea {
  transition:
    background-color var(--acs-transition),
    border-color var(--acs-transition),
    box-shadow var(--acs-transition);
}

button,
input[type="button"],
input[type="submit"] {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--acs-accent);
  outline-offset: 3px;
}

input,
select,
textarea {
  max-width: 100%;
}

img,
svg,
canvas {
  max-width: 100%;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  overflow-wrap: anywhere;
}

#root {
  min-height: 100vh;
  width: 100%;
}

/* Smooth cards and panels without changing their original colors */
#root [class*="rounded-xl"],
#root [class*="rounded-2xl"] {
  transition:
    border-color var(--acs-transition),
    box-shadow var(--acs-transition);
}

#root [class*="shadow-sm"],
#root [class*="shadow-md"] {
  box-shadow: 0 3px 14px rgb(15 23 42 / 5%);
}

#root button {
  min-height: 36px;
}

#root input,
#root select,
#root textarea {
  border-radius: 9px;
}

#root input:focus,
#root select:focus,
#root textarea:focus {
  border-color: var(--acs-accent);
  box-shadow: 0 0 0 3px rgb(83 120 245 / 14%);
}

/* Desktop */
@media (min-width: 1024px) {
  #root {
    min-width: 0;
  }

  #root [class*="overflow-x-auto"] {
    scrollbar-width: thin;
  }
}

/* Tablet and mobile */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 72px;
  }

  body {
    overflow-x: hidden;
  }

  #root {
    min-width: 0;
    overflow-wrap: break-word;
  }

  #root main,
  #root [role="main"] {
    min-width: 0;
    max-width: 100%;
  }

  #root table {
    min-width: 600px;
  }

  #root [class*="overflow-x-auto"] {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #root input,
  #root select,
  #root textarea {
    font-size: 16px;
  }

  #root button {
    min-height: 40px;
  }

  #root img {
    height: auto;
  }
}

@media (max-width: 480px) {
  #root [class*="gap-6"] {
    gap: 1rem;
  }

  #root [class*="gap-5"] {
    gap: 0.875rem;
  }

  #root [class*="rounded-2xl"] {
    border-radius: 12px;
  }

  #root button {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
