/* ============================================================
   RemoteDesk Review LLC — Custom Styles
   Supplements Tailwind CSS
   Palette: Deep Ocean Blue
   Fonts: Archivo (headings) + Red Hat Display (body)
   ============================================================ */

/* ----- Base ---------------------------------------------- */
html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ----- Font imports (self-hosted or via CDN in HTML) ------ */
/* Archivo: headings | Red Hat Display: body                  */

/* ----- Reduced motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-target.animated {
    transition: none !important;
  }
}

/* ----- Focus-visible (keyboard navigation) --------------- */
:focus-visible {
  outline: 3px solid #38bdf8; /* brand-400 */
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* =========================================================
   COOKIE CONSENT BANNER
   ========================================================= */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: #082f49; /* brand-900 */
  color: #e0f2fe; /* brand-100 */
  padding: 1rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner a {
  color: #7dd3fc; /* brand-300 */
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.cookie-banner a:hover {
  color: #bae6fd; /* brand-200 */
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* =========================================================
   SCROLL ANIMATIONS
   Content is ALWAYS visible by default.
   JS adds .animated for a subtle entrance effect.
   ========================================================= */
.fade-target {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Prepare state — only applied by JS after observer is set up */
.fade-target.fade-ready {
  opacity: 0;
  transform: translateY(24px);
}

.fade-target.animated {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   FORM FOCUS STATES & VALIDATION
   ========================================================= */
input,
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #0ea5e9; /* brand-500 */
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  outline: none;
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

.form-error-message {
  color: #ef4444;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: none;
}

.field-invalid .form-error-message {
  display: block;
}

.form-success-panel {
  background-color: #f0f9ff; /* brand-50 */
  border: 2px solid #0ea5e9; /* brand-500 */
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
}

/* =========================================================
   MOBILE MENU
   ========================================================= */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}

.mobile-menu.is-open {
  max-height: 500px;
  opacity: 1;
}

body.menu-open {
  overflow: hidden;
}

/* Hamburger icon animation */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* =========================================================
   STICKY HEADER
   ========================================================= */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background-color: #082f49; /* brand-900 */
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   COMPARISON TABLE
   ========================================================= */
.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Custom scrollbar for comparison table */
.comparison-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.comparison-table-wrap::-webkit-scrollbar-track {
  background: #e0f2fe; /* brand-100 */
  border-radius: 4px;
}

.comparison-table-wrap::-webkit-scrollbar-thumb {
  background: #0ea5e9; /* brand-500 */
  border-radius: 4px;
}

.comparison-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #0369a1; /* brand-600 */
}

/* Firefox scrollbar */
.comparison-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #0ea5e9 #e0f2fe;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #bae6fd; /* brand-200 */
  white-space: nowrap;
}

.comparison-table thead th {
  background-color: #0c4a6e; /* brand-700 */
  color: #f0f9ff; /* brand-50 */
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Sticky first column on desktop */
@media (min-width: 768px) {
  .comparison-table th:first-child,
  .comparison-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #f0f9ff; /* brand-50 */
    font-weight: 600;
    min-width: 180px;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.06);
  }

  .comparison-table thead th:first-child {
    z-index: 15;
    background-color: #0c4a6e; /* brand-700 */
  }
}

.comparison-table tbody tr:hover {
  background-color: #e0f2fe; /* brand-100 */
}

/* Scroll indicator */
.scroll-indicator {
  display: none;
  text-align: center;
  font-size: 0.75rem;
  color: #0369a1; /* brand-600 */
  padding: 0.5rem;
  animation: scrollHint 1.5s ease-in-out infinite;
}

@keyframes scrollHint {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(6px);
  }
}

/* Card stack layout on mobile */
@media (max-width: 767px) {
  .comparison-table-wrap {
    overflow-x: visible;
  }

  .scroll-indicator {
    display: none;
  }

  .comparison-table,
  .comparison-table thead,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
  }

  .comparison-table thead {
    display: none;
  }

  .comparison-table tbody tr {
    background-color: #ffffff;
    border: 1px solid #bae6fd; /* brand-200 */
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }

  .comparison-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    white-space: normal;
    border-bottom: 1px solid #e0f2fe; /* brand-100 */
  }

  .comparison-table td:last-child {
    border-bottom: none;
  }

  .comparison-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-family: "Archivo", sans-serif;
    color: #0c4a6e; /* brand-700 */
    flex-shrink: 0;
    margin-right: 1rem;
  }
}

/* =========================================================
   PRODUCT ICON CONTAINERS
   ========================================================= */
.product-icon {
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: #f0f9ff; /* brand-50 */
  border: 2px solid #bae6fd; /* brand-200 */
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-icon:hover {
  border-color: #0ea5e9; /* brand-500 */
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.product-icon svg,
.product-icon img {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
}

/* =========================================================
   BOOK MOCKUP — 3D PERSPECTIVE
   ========================================================= */
.book-mockup {
  perspective: 800px;
  display: inline-block;
}

.book-cover {
  width: 220px;
  height: 320px;
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0ea5e9 100%);
  border-radius: 0 8px 8px 0;
  box-shadow:
    6px 6px 18px rgba(0, 0, 0, 0.3),
    inset -2px 0 4px rgba(0, 0, 0, 0.15);
  transform: rotateY(-15deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #f0f9ff; /* brand-50 */
  text-align: center;
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.05)
  );
  border-radius: 0;
}

.book-cover::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  pointer-events: none;
}

.book-mockup:hover .book-cover {
  transform: rotateY(-5deg) rotateX(1deg);
  box-shadow:
    10px 10px 30px rgba(0, 0, 0, 0.35),
    inset -2px 0 4px rgba(0, 0, 0, 0.15);
}

.book-title {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.book-author {
  font-family: "Red Hat Display", sans-serif;
  font-size: 0.8125rem;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* =========================================================
   BUTTONS — HOVER MICRO-INTERACTIONS
   ========================================================= */
.btn,
button[type="submit"],
.cta-button {
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.2s ease;
}

.btn:hover,
button[type="submit"]:hover,
.cta-button:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.btn:active,
button[type="submit"]:active,
.cta-button:active {
  transform: scale(0.98);
}

/* =========================================================
   CARDS — HOVER EFFECTS
   ========================================================= */
.card,
.feature-card,
.review-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.feature-card:hover,
.review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(5, 30, 49, 0.12);
}

/* =========================================================
   LINKS — COLOR TRANSITIONS
   ========================================================= */
a {
  transition: color 0.2s ease;
}

a:hover {
  color: #0ea5e9; /* brand-500 */
}

/* =========================================================
   SECTION HEADING — UPPERCASE SMALL LABEL
   ========================================================= */
.section-label {
  font-family: "Archivo", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0ea5e9; /* brand-500 */
  margin-bottom: 0.5rem;
  display: block;
}

/* =========================================================
   EDITORIAL TYPOGRAPHY
   ========================================================= */
blockquote {
  border-left: 4px solid #0ea5e9; /* brand-500 */
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #0a3d5c; /* brand-800 */
  background-color: #f0f9ff; /* brand-50 */
  border-radius: 0 0.5rem 0.5rem 0;
  font-family: "Red Hat Display", sans-serif;
}

blockquote p {
  margin: 0;
}

blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 600;
  color: #0369a1; /* brand-600 */
}

.pull-quote {
  font-family: "Archivo", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: #0c4a6e; /* brand-700 */
  text-align: center;
  padding: 2rem 1.5rem;
  margin: 2rem 0;
  position: relative;
}

.pull-quote::before,
.pull-quote::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, #0ea5e9, #38bdf8);
  margin: 0 auto;
  border-radius: 2px;
}

.pull-quote::before {
  margin-bottom: 1.5rem;
}

.pull-quote::after {
  margin-top: 1.5rem;
}

/* =========================================================
   SECTION BORDER DIVIDER
   ========================================================= */
.section-divider {
  border-top: 1px solid #bae6fd; /* brand-200 */
}

/* =========================================================
   FAQ ACCORDION (details/summary)
   ========================================================= */
details {
  border-bottom: 1px solid #bae6fd; /* brand-200 */
}

details summary {
  cursor: pointer;
  padding: 1rem 0;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  color: #0c4a6e; /* brand-700 */
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  color: #0ea5e9; /* brand-500 */
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

details[open] summary::after {
  content: "\2212"; /* minus sign */
  transform: rotate(180deg);
}

details summary:hover {
  color: #0ea5e9; /* brand-500 */
}

details .faq-answer {
  padding: 0 0 1rem 0;
  color: #0a3d5c; /* brand-800 */
  line-height: 1.7;
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  /* Hide non-essential elements */
  .cookie-banner,
  .mobile-menu,
  .hamburger,
  .site-header,
  .scroll-indicator,
  .btn,
  .cta-button,
  nav,
  footer,
  #cookie-banner {
    display: none !important;
  }

  /* Page breaks */
  h1,
  h2,
  h3 {
    page-break-after: avoid;
    orphans: 3;
    widows: 3;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  table {
    border-collapse: collapse !important;
  }

  table th,
  table td {
    border: 1px solid #ccc !important;
    padding: 0.5rem !important;
  }

  .comparison-table th:first-child,
  .comparison-table td:first-child {
    position: static;
    box-shadow: none;
  }

  .book-cover {
    transform: none;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  }
}
