/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Prevent horizontal layout shift from scrollbar appearance/disappearance */
html {
  scrollbar-gutter: stable;
}

/* Notes expansion animation */
.notes-content {
  max-height: 0;
}

.notes-content.expanded {
  max-height: 10rem; /* 160px - enough for notes with scroll */
}

/* Chevron rotation when notes expanded */
.notes-chevron-expanded {
  transform: rotate(90deg);
}

/* Mobile touch targets - minimum 44px for accessibility */
@media (max-width: 767px) {
  .action-card-touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Elevate focused cards above siblings so focus ring is not clipped */
.action-card:focus,
.action-card:focus-within {
  z-index: 10;
  position: relative;
}

/* Prevent double-tap zoom on mobile touch targets */
.action-card button,
.action-card a {
  touch-action: manipulation;
}

/* Invisible touch target expansion for small elements (44x44px minimum) */
@media (max-width: 767px) {
  .unified-touch-expand {
    position: relative;
  }

  .unified-touch-expand::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
  }
}

/* Prevent double-tap zoom on unified card touch targets */
.unified-card button,
.unified-card a {
  touch-action: manipulation;
}

/* Swipe card content: allow vertical scroll, prevent horizontal pan default */
.swipe-content {
  touch-action: pan-y;
  width: 100%;
  will-change: transform;
  z-index: 1;
}

/* Prevent text selection during swipe gesture */
.unified-card.swiping {
  user-select: none;
  -webkit-user-select: none;
}

/* Depth shadow on content edge during active swipe (visual separation from action panel) */
.unified-card.swiping .swipe-content {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* Show swipe panels when actively swiping */
.unified-card.swiping [data-swipe-target="leftActions"],
.unified-card.swiping [data-swipe-target="rightActions"] {
  opacity: 1;
}

/* Swipe action panels: hidden on desktop */
@media (min-width: 768px) {
  [data-swipe-target="leftActions"],
  [data-swipe-target="rightActions"] {
    display: none;
  }
}
