/* Lucide icon styles */
.lucide-external-link {
  width: 1em;
  height: 1em;
  margin-left: 0.25em;
  display: inline-block;
  vertical-align: middle;
}

/* Responsive signing iframe styles */
@media (max-width: 639px) {
  #signingIframe {
    /* Ensure iframe fits within small screens */
    width: 100% !important;
    height: 100% !important;
    min-height: 400px;
    /* Allow touch gestures for zooming */
    touch-action: manipulation;
    /* Scale content to fit by default */
    transform-origin: top left;
  }

  /* Ensure modal takes full advantage of small screen space */
  #signingModal .bg-white {
    margin: 0.5rem;
    border-radius: 0.5rem;
  }
}

/* For very small screens (350px-399px) */
@media (max-width: 399px) {
  #signingModal {
    padding: 0.25rem !important;
  }

  #signingModal .bg-white {
    margin: 0.25rem;
    max-height: 98vh !important;
  }

  #signingIframe {
    min-height: 350px;
  }
}

/* For small tablets and larger phones (400px-550px) */
@media (min-width: 400px) and (max-width: 550px) {
  #signingIframe {
    min-height: 450px;
  }
}

/* Mobile navigation menu styles */
#mobileMenu {
  animation: slideDown 0.2s ease-out;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#mobileMenu.hidden {
  animation: slideUp 0.15s ease-in;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Ensure mobile menu button is accessible */
#mobileMenuButton:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Mobile menu item hover effects */
#mobileMenu a {
  transition: all 0.15s ease-in-out;
}

/* Responsive adjustments for very small screens */
@media (max-width: 320px) {
  #mobileMenu {
    width: calc(100vw - 1rem);
    right: 0.5rem;
  }
}

/* Mobile specific styles for warning tooltips */
@media (max-width: 768px) {
  .warning-tooltip {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: calc(100vw - 2rem) !important;
    min-width: calc(100vw - 4rem) !important;
    margin: 0 !important;
    z-index: 1000 !important;
  }

  .tooltip-arrow {
    display: none !important;
  }

  .warning-tooltip::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }
}

/* Invoice warning tooltip styles - must be outside @layer to work */
.warning-icon-container {
  position: relative;
  display: inline-block;
}

.warning-icon {
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.warning-icon:hover {
  transform: scale(1.1);
}

.warning-tooltip {
  position: fixed;
  z-index: 1000;
  padding: 0.75rem 1rem;
  min-width: 12rem;
  max-width: 24rem;
  background-color: #1f2937;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  /* Position will be set dynamically by JavaScript */
}

.warning-tooltip.opacity-100 {
  opacity: 1 !important;
  pointer-events: auto;
}

.tooltip-arrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

/* Warning severity colors */
.warning-severity-low {
  color: #eab308; /* yellow-500 */
}

.warning-severity-medium {
  color: #f97316; /* orange-500 */
}

.warning-severity-high {
  color: #ef4444; /* red-500 */
}