/**
 * Action Pills Styles
 * Glassy, classy pill buttons for desktop action buttons (USE, EDIT, COPY, SHARE)
 * Desktop-only styling - mobile remains icon-only
 */

/* Desktop-only pill button styles */
@media (min-width: 769px) {
  /* Base pill button styling */
  .message-action-btn.action-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-width: 80px;
    width: 80px;
    height: auto;
    min-height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0.85;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  /* Icon styling within pills */
  .message-action-btn.action-pill img {
    width: 16px;
    height: 16px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
  }

  /* Text label styling */
  .message-action-btn.action-pill .pill-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    transition: color 0.2s ease;
  }

  /* Hover state - reactive and classy */
  .message-action-btn.action-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  }

  .message-action-btn.action-pill:hover img {
    opacity: 1;
  }

  .message-action-btn.action-pill:hover .pill-label {
    color: rgba(255, 255, 255, 1);
  }

  /* Active/pressed state */
  .message-action-btn.action-pill:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  }

  /* Edit button - keep icon white, no orange styling */
  .message-action-btn.action-pill.edit {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
  }

  .message-action-btn.action-pill.edit img {
    filter: none;
    opacity: 0.9;
  }

  /* Specific button hover colors (subtle) */
  .message-action-btn.action-pill.use:hover {
    background: rgba(74, 158, 255, 0.12);
    border-color: rgba(74, 158, 255, 0.3);
  }

  .message-action-btn.action-pill.edit:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  }

  .message-action-btn.action-pill.copy:hover {
    background: rgba(40, 167, 69, 0.12);
    border-color: rgba(40, 167, 69, 0.3);
  }

  .message-action-btn.action-pill.download:hover {
    background: rgba(74, 158, 255, 0.12);
    border-color: rgba(74, 158, 255, 0.3);
  }

  .message-action-btn.action-pill.share:hover {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.3);
  }

  /* Loading state */
  .message-action-btn.action-pill.loading {
    pointer-events: none;
    opacity: 0.6;
    transform: scale(0.95);
  }

  /* Success/copied state */
  .message-action-btn.action-pill.success,
  .message-action-btn.action-pill.copied,
  .message-action-btn.action-pill.downloaded {
    background: rgba(40, 167, 69, 0.2) !important;
    border-color: rgba(40, 167, 69, 0.4) !important;
  }

  .message-action-btn.action-pill.success img,
  .message-action-btn.action-pill.copied img,
  .message-action-btn.action-pill.downloaded img {
    filter: brightness(1.2);
  }

  /* Ensure actions container spacing works with pills */
  .message-actions .message-action-btn.action-pill {
    margin: 0;
  }

  /* Comparison bubble pills - ensure they display correctly */
  .comparison-bubble-message .message-action-btn.action-pill {
    width: 80px;
    min-width: 80px;
  }
}

/* Mobile: Hide labels and show icon-only buttons */
@media (max-width: 768px) {
  /* Hide pill labels on mobile */
  .message-action-btn.action-pill .pill-label {
    display: none !important;
  }

  /* Make buttons icon-only (square) on mobile - override pill styles */
  .message-action-btn.action-pill {
    width: 30px !important; /* 15% bigger than 26px (26 * 1.15 = 29.9) */
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    gap: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: 0 !important; /* Remove any left margin */
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* Match existing mobile button styles */
    background: rgba(20, 20, 20, 0.08) !important;
    border: 0px solid rgba(255, 255, 255, 0.12) !important;
  }

  /* Ensure icon is centered and sized appropriately */
  .message-action-btn.action-pill img {
    width: 25px !important; /* Proportionally larger */
    height: 25px !important;
    margin: 0 !important;
  }

  /* Comparison bubble buttons on mobile */
  .comparison-bubble-message .message-action-btn.action-pill {
    width: 30px !important;
    min-width: 30px !important;
  }
}

/* Very small screens - even more compact */
@media (max-width: 375px) {
  .message-action-btn.action-pill {
    width: 30px !important; /* 15% bigger than 26px (26 * 1.15 = 29.9) */
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }

  .message-action-btn.action-pill img {
    width: 18px !important; /* Proportionally larger */
    height: 18px !important;
  }
}

