/* ==================================================
   Button Components - Consolidated Styles
   Single source of truth for all button patterns
   ================================================== */

/* Button Base */
.btn {
  @apply inline-flex items-center justify-center font-semibold rounded-md transition-all duration-200;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-height: 48px;
  line-height: 1.25;
}

/* Button Variants */
.btn-primary,
button.btn-primary,
a.btn-primary {
  background-color: var(--app-accent-blue);
  background-image: none;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

/* Allow gradient backgrounds to override default blue */
.btn-primary[class*="gradient"] {
  background-color: initial !important;
  background-image: initial !important;
}

.btn-primary:hover:not([class*="bg-gradient"]) {
  background: #3A8FC8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary[class*="bg-gradient"]:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary {
  background: transparent;
  border: 1px solid var(--app-border-emphasis);
  color: var(--app-accent-blue);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(74, 159, 216, 0.1);
  border-color: var(--app-accent-blue);
}

.btn-cta {
  background: var(--app-accent-orange);
  color: white;
  border: none;
}

.btn-cta:hover {
  background: #D88A50;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(232, 154, 95, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--app-text-secondary);
  border: none;
}

.btn-ghost:hover {
  background: rgba(138, 180, 207, 0.1);
  color: var(--app-text-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--app-border-default);
  color: var(--app-text-secondary);
}

.btn-outline:hover {
  background: rgba(138, 180, 207, 0.1);
  border-color: var(--app-border-emphasis);
  color: var(--app-text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 18px;
}

/* Button States */
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* Social Buttons */
.btn-social {
  @apply btn border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus:ring-primary-500;
}

.btn-social-surface {
  background: var(--app-bg-surface);
  border: 1px solid var(--app-border-subtle);
  color: var(--app-text-primary);
}

/* Gradient Buttons */
.btn-discover {
  background: linear-gradient(135deg, var(--app-accent-magenta) 0%, var(--app-accent-orange) 100%);
  border: none;
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  padding-left: 48px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(184, 118, 192, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.btn-discover:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 118, 192, 0.4);
}

/* Icon swap effect: pyramid-mono fades out, colorful pyramid fades in */
/* Both icons positioned absolutely at the same location to prevent movement */
.btn-discover .icon-pyramid-mono,
.btn-discover .icon-pyramid-hover {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.btn-discover .icon-pyramid-mono {
  opacity: 1;
  visibility: visible;
}

.btn-discover:hover .icon-pyramid-mono {
  opacity: 0;
  visibility: hidden;
}

.btn-discover .icon-pyramid-hover {
  opacity: 0;
  visibility: hidden;
}

.btn-discover:hover .icon-pyramid-hover {
  opacity: 1;
  visibility: visible;
}

/* Genome Button */
.btn-genome,
button.btn-genome,
a.btn-genome {
  background: linear-gradient(135deg, #5FCF5F 0%, #038BEA 100%);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(95, 207, 95, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.btn-genome:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(95, 207, 95, 0.4);
}

/* Genome Secondary Button */
.btn-genome-secondary,
button.btn-genome-secondary,
a.btn-genome-secondary {
  background: transparent;
  border: 1px solid var(--app-border-subtle);
  color: var(--app-text-secondary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-genome-secondary:hover {
  background: rgba(82, 197, 199, 0.1);
  border-color: rgba(82, 197, 199, 0.5);
  color: var(--app-text-primary);
}

/* Research Button (Networking Intelligence) */
.btn-research,
button.btn-research,
a.btn-research {
  background: linear-gradient(135deg, #B6D3E7 0%, #038BEA 100%);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(182, 211, 231, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.btn-research:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(182, 211, 231, 0.4);
}

/* Connection-specific Action Buttons */
.bulk-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}

.bulk-action-btn i {
  margin-right: 6px;
}

.bulk-action-btn.message {
  background: transparent;
  border-color: rgba(74, 159, 216, 0.5);
  color: var(--app-accent-blue);
}

.bulk-action-btn.message:hover {
  background: rgba(74, 159, 216, 0.15);
  border-color: var(--app-accent-blue);
}

.bulk-action-btn.export {
  background: transparent;
  border-color: rgba(74, 159, 216, 0.5);
  color: var(--app-accent-blue);
}

.bulk-action-btn.export:hover {
  background: rgba(74, 159, 216, 0.15);
  border-color: var(--app-accent-blue);
}

.bulk-action-btn.remove {
  background: transparent;
  border-color: rgba(231, 111, 111, 0.5);
  color: var(--app-accent-red);
}

.bulk-action-btn.remove:hover {
  background: rgba(231, 111, 111, 0.15);
  border-color: var(--app-accent-red);
}

/* Table Action Buttons */
.table-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.table-action-btn i {
  width: 20px;
  height: 20px;
}

.table-action-btn.view {
  color: var(--app-accent-blue);
}

.table-action-btn.view:hover {
  background: rgba(74, 159, 216, 0.1);
}

.table-action-btn.message {
  color: var(--app-accent-green);
}

.table-action-btn.message:hover {
  background: rgba(107, 192, 112, 0.1);
}

.table-action-btn.profile {
  color: var(--app-text-secondary);
}

.table-action-btn.profile:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.1);
}

/* Clear Selection Button */
.clear-selection-btn {
  background: none;
  border: none;
  color: var(--app-accent-blue);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
  padding: 0;
}

.clear-selection-btn:hover {
  color: #3A8FC8;
  text-decoration: underline;
}

/* Navigation Settings Button */
.nav-settings-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--app-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--duration-base);
}

.nav-settings-btn:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.1);
}

/* Mobile Navigation Buttons */
.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--app-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--duration-base);
}

.mobile-nav-btn:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.1);
}

.mobile-nav-close {
  background: transparent;
  border: none;
  color: var(--app-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--duration-base);
}

.mobile-nav-close:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.1);
}

/* Sybil-specific Button Utilities */
.sybil-btn-subtle {
  color: var(--app-text-tertiary);
  background: rgba(138, 180, 207, 0.05);
}

.sybil-btn-subtle:hover {
  background: rgba(138, 180, 207, 0.1);
}

/* Pagination Buttons */
.pagination-btn {
  padding: 8px 12px;
  background: var(--app-bg-surface);
  border: none;
  border-right: 1px solid var(--app-border-subtle);
  color: var(--app-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:last-child {
  border-right: none;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--app-bg-elevated);
  color: var(--app-text-primary);
}

.pagination-btn.active {
  background: rgba(74, 159, 216, 0.2);
  border-color: var(--app-accent-blue);
  color: var(--app-accent-blue);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn i {
  width: 16px;
  height: 16px;
}

.pagination-mobile-btn {
  flex: 1;
  padding: 12px 16px;
  background: var(--app-bg-surface);
  border: 1px solid var(--app-border-subtle);
  color: var(--app-text-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-mobile-btn:hover:not(:disabled) {
  background: var(--app-bg-elevated);
  color: var(--app-text-primary);
  border-color: var(--app-border-default);
}

.pagination-mobile-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tab Buttons */
.tab-button {
  border-color: transparent;
  color: var(--app-text-secondary);
  background: none;
  border: none;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-button:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.05);
}

.tab-button.active {
  color: var(--app-accent-blue);
  border-bottom: 2px solid var(--app-accent-blue);
}

/* Dropdown Item Buttons */
.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
  color: var(--app-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--app-bg-elevated);
}

.dropdown-item i {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dropdown-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--app-text-tertiary);
}

/* Navigation Dropdown Items */
.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 14px;
  color: var(--app-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-base);
}

.nav-dropdown-item:hover {
  color: var(--app-text-primary);
  background: rgba(138, 180, 207, 0.1);
}

.nav-dropdown-item:active {
  background: rgba(138, 180, 207, 0.15);
}

/* Focus Visible States */
.btn:focus-visible,
.nav-settings-btn:focus-visible,
.nav-dropdown-item:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--app-accent-blue);
  outline-offset: 2px;
}