/* Sharp Performance - Custom Styles */

html {
  overflow-x: hidden;
}

body {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
a,
span,
button,
label {
  overflow-wrap: anywhere;
}

/* HTMX loading indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }

/* Smooth transitions for HTMX swaps */
.htmx-swapping { opacity: 0; transition: opacity 200ms ease-out; }
.htmx-settling { opacity: 1; transition: opacity 200ms ease-in; }

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Toast animation */
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-slide-in { animation: slide-in 0.3s ease-out; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0E1821; }
::-webkit-scrollbar-thumb { background: #394E64; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #50C4ED; }

/* Pipeline card drag styles */
.dragging { opacity: 0.5; }
[x-cloak] { display: none !important; }

/* Cyan glow effect for CTAs */
.shadow-cyan-glow {
  box-shadow: 0 0 20px rgba(80, 196, 237, 0.3), 0 0 40px rgba(80, 196, 237, 0.1);
}

/* Focus ring override */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 2px rgba(80, 196, 237, 0.2);
}

/* Alpine x-collapse polyfill */
[x-collapse] { overflow: hidden; }

#toast-container .toast {
  width: min(100%, 24rem);
}

.portal-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1023px) {
  .portal-table-scroll {
    border-radius: 1rem;
  }

  .portal-table-scroll table {
    min-width: max(100%, 720px);
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  main section {
    scroll-margin-top: 5rem;
  }

  .mobile-stack > * {
    width: 100%;
  }

  .mobile-cta,
  .mobile-cta-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .mobile-card {
    padding: 1.25rem !important;
    border-radius: 1rem;
  }

  .mobile-tight-text {
    letter-spacing: 0.12em !important;
  }

  .mobile-video-frame {
    border-radius: 0.875rem;
  }

  .mobile-icon-list li {
    align-items: flex-start;
  }

  .form-panel {
    padding: 1.25rem !important;
  }

  .logo-card {
    min-width: 0;
    padding: 1rem 1.25rem;
  }

  .logo-card img {
    max-height: 3rem;
  }

  .portal-table-scroll table {
    min-width: 680px;
  }

  .portal-table-scroll th,
  .portal-table-scroll td {
    white-space: nowrap;
  }

  .portal-table-scroll td:last-child,
  .portal-table-scroll th:last-child {
    position: sticky;
    right: 0;
    background: rgba(22, 34, 48, 0.98);
  }

  .mobile-scroll-hint {
    font-size: 0.75rem;
    color: #9ca3af;
  }

  table th,
  table td {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }

  .instagram-media {
    min-width: 0 !important;
    width: 100% !important;
  }

  .portal-page-header {
    gap: 0.875rem;
    align-items: stretch;
  }

  .portal-page-header > * {
    width: 100%;
  }

  .portal-page-actions,
  .portal-inline-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .portal-page-actions > *,
  .portal-inline-actions > * {
    width: 100%;
  }

  .portal-inline-actions button,
  .portal-inline-actions a,
  .portal-page-actions button,
  .portal-page-actions a {
    justify-content: center;
    text-align: center;
  }

  .portal-panel {
    padding: 1rem !important;
    border-radius: 1rem;
  }

  .portal-panel-header {
    gap: 0.5rem;
    align-items: flex-start;
  }

  .portal-panel-header > * {
    width: 100%;
  }
}

/* Form surfaces */
.form-panel {
  background: radial-gradient(circle at top, rgba(80, 196, 237, 0.12), rgba(14, 24, 33, 0.96));
  border: 1px solid rgba(80, 196, 237, 0.18);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 0 30px rgba(80, 196, 237, 0.15);
  backdrop-filter: blur(10px);
}
.form-panel h3 {
  letter-spacing: 0.08em;
}

.logo-card {
  background: linear-gradient(135deg, rgba(80, 196, 237, 0.1), rgba(80, 196, 237, 0.02));
  border: 1px solid rgba(80, 196, 237, 0.15);
  border-radius: 1.25rem;
  padding: 1.5rem 2rem;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.logo-card img {
  filter: grayscale(1) brightness(1.25);
  opacity: 0.9;
}
