/**
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * BLOCKEXPLORER BUTTONS - Purple/Blue "Electric Glass" Theme
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *
 * Button Library: Glassmorphism button styles
 * Color Palette: Purple/Blue gradients (NOT Fulgura green)
 *
 * All buttons use BlockExplorer's Purple/Blue identity.
 * For Fulgura brand green (#C5EE49), see DEX project.
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */

/* ============================================
   BUTTON VARIABLES
   ============================================ */
:root {
  /* Button Sizes */
  --btn-height-sm: 32px;
  --btn-height-md: 44px;
  --btn-height-lg: 56px;
  --btn-height-xl: 68px;

  /* Circular Button Sizes */
  --btn-circular-sm: 40px;
  --btn-circular-md: 56px;
  --btn-circular-lg: 72px;
  --btn-circular-xl: 96px;

  /* Button Spacing */
  --btn-padding-sm: var(--space-2) var(--space-4);
  --btn-padding-md: var(--space-4) var(--space-6);
  --btn-padding-lg: var(--space-5) var(--space-8);

  /* Button Shadows - Dark Theme */
  --btn-shadow-raised: 8px 8px 20px rgba(0, 0, 0, 0.7), -8px -8px 20px rgba(60, 60, 90, 0.4);
  --btn-shadow-hover: 12px 12px 28px rgba(0, 0, 0, 0.8), -12px -12px 28px rgba(80, 80, 110, 0.5);
  --btn-shadow-pressed: inset 4px 4px 10px rgba(0, 0, 0, 0.8), inset -4px -4px 10px rgba(40, 40, 60, 0.3);

  /* Button Gradient */
  --btn-gradient-primary: linear-gradient(145deg, #9333ea, #7928ca);
  --btn-gradient-hover: linear-gradient(145deg, #a855f7, #8b5cf6);
  --btn-gradient-active: linear-gradient(145deg, #7928ca, #6b21a8);

  /* Button Transitions */
  --btn-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --btn-transition-fast: all 0.3s ease;
}

/* ============================================
   BASE BUTTON STYLES
   ============================================ */
.btn,
.btn-neomorph {
  position: relative;
  padding: var(--btn-padding-md);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: var(--font-semibold);
  font-size: var(--font-base);
  cursor: pointer;
  transition: var(--btn-transition);
  font-family: var(--font-primary);
  outline: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

/* ============================================
   NEOMORPHIC RAISED BUTTON
   ============================================ */
.btn-neomorph {
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(15, 15, 30, 0.9));
  box-shadow:
    var(--btn-shadow-raised),
    inset 0 0 0 1px rgba(138, 43, 226, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

.btn-neomorph:hover {
  background: linear-gradient(145deg, rgba(35, 35, 55, 0.9), rgba(20, 20, 35, 0.95));
  box-shadow:
    var(--btn-shadow-hover),
    inset 0 0 0 1px rgba(138, 43, 226, 0.3),
    0 0 40px rgba(138, 43, 226, 0.4);
  transform: translateY(-2px);
}

.btn-neomorph:active {
  background: linear-gradient(145deg, rgba(15, 15, 30, 0.95), rgba(20, 20, 35, 0.9));
  box-shadow: var(--btn-shadow-pressed);
  transform: translateY(0);
}

/* ============================================
   NEOMORPHIC PRESSED BUTTON
   ============================================ */
.btn-neomorph-pressed {
  background: linear-gradient(145deg, rgba(15, 15, 30, 0.9), rgba(25, 25, 40, 0.85));
  box-shadow:
    inset 6px 6px 12px rgba(0, 0, 0, 0.7),
    inset -6px -6px 12px rgba(50, 50, 70, 0.2);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--btn-padding-md);
  border-radius: var(--radius-lg);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: var(--btn-transition-fast);
}

.btn-neomorph-pressed:hover {
  box-shadow:
    inset 8px 8px 16px rgba(0, 0, 0, 0.75),
    inset -8px -8px 16px rgba(55, 55, 75, 0.25);
}

/* ============================================
   PRIMARY GRADIENT BUTTON
   ============================================ */
.btn-neomorph-primary {
  background: var(--btn-gradient-primary);
  box-shadow:
    8px 8px 16px rgba(0, 0, 0, 0.6),
    -8px -8px 16px rgba(138, 43, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: var(--btn-padding-md);
  border-radius: var(--radius-lg);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: var(--btn-transition-fast);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect */
.btn-neomorph-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-neomorph-primary:hover::before {
  left: 100%;
}

.btn-neomorph-primary:hover {
  background: var(--btn-gradient-hover);
  box-shadow:
    12px 12px 24px rgba(0, 0, 0, 0.7),
    -12px -12px 24px rgba(138, 43, 226, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 30px rgba(138, 43, 226, 0.5);
  transform: translateY(-2px);
}

.btn-neomorph-primary:active {
  background: var(--btn-gradient-active);
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.6),
    inset -4px -4px 8px rgba(138, 43, 226, 0.2);
  transform: translateY(0);
}

/* ============================================
   CIRCULAR ICON BUTTONS - NEOMORPHIC
   ============================================ */
.btn-neomorph-icon {
  width: var(--btn-circular-md);
  height: var(--btn-circular-md);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(15, 15, 30, 0.9));
  box-shadow:
    var(--btn-shadow-raised),
    inset 0 0 0 1px rgba(138, 43, 226, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: var(--btn-transition);
  border: none;
  position: relative;
  overflow: visible;
}

/* Glow ring effect */
.btn-neomorph-icon::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: var(--gradient-text);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  filter: blur(8px);
}

.btn-neomorph-icon:hover::before {
  opacity: 0.6;
  animation: pulse-glow 2s ease-in-out infinite;
}

.btn-neomorph-icon:hover {
  box-shadow:
    var(--btn-shadow-hover),
    inset 0 0 0 1px rgba(138, 43, 226, 0.3),
    0 0 40px rgba(138, 43, 226, 0.4);
  transform: translateY(-4px) scale(1.05);
}

.btn-neomorph-icon:active {
  box-shadow: var(--btn-shadow-pressed);
  transform: translateY(0) scale(0.95);
}

.btn-neomorph-icon i {
  font-size: 1.4rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.6));
  transition: all 0.3s ease;
}

.btn-neomorph-icon:hover i {
  filter: drop-shadow(0 0 12px rgba(138, 43, 226, 0.9));
  transform: scale(1.1);
}

/* ============================================
   CIRCULAR GRADIENT BUTTON
   ============================================ */
.btn-circular-gradient {
  width: var(--btn-circular-md);
  height: var(--btn-circular-md);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #9333ea, #4169e1);
  box-shadow:
    0 8px 24px rgba(138, 43, 226, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #ffffff;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--btn-transition);
}

.btn-circular-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-circular-gradient:hover::before {
  opacity: 1;
}

.btn-circular-gradient:hover {
  box-shadow:
    0 12px 36px rgba(138, 43, 226, 0.6),
    0 6px 18px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 50px rgba(138, 43, 226, 0.5);
  transform: translateY(-6px) scale(1.08);
}

.btn-circular-gradient:active {
  transform: translateY(0) scale(0.92);
  box-shadow:
    0 4px 12px rgba(138, 43, 226, 0.3),
    inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-circular-gradient i {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.btn-circular-gradient:hover i {
  transform: rotate(15deg) scale(1.1);
}

/* ============================================
   CIRCULAR GLASS BUTTON
   ============================================ */
.btn-circular-glass {
  width: var(--btn-circular-md);
  height: var(--btn-circular-md);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(138, 43, 226, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(138, 43, 226, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  position: relative;
  transition: var(--btn-transition);
}

/* Light reflection */
.btn-circular-glass::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.6;
}

.btn-circular-glass:hover {
  background: rgba(138, 43, 226, 0.25);
  border-color: rgba(138, 43, 226, 0.7);
  box-shadow:
    0 12px 48px rgba(138, 43, 226, 0.4),
    0 0 60px rgba(138, 43, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-6px) scale(1.05);
}

.btn-circular-glass:active {
  transform: scale(0.92);
  background: rgba(138, 43, 226, 0.3);
}

.btn-circular-glass i {
  font-size: 1.4rem;
  background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.8));
  transition: all 0.3s ease;
  z-index: 1;
}

.btn-circular-glass:hover i {
  filter: drop-shadow(0 0 16px rgba(138, 43, 226, 1));
  transform: scale(1.15);
}

/* ============================================
   NOTIFICATION BADGE
   ============================================ */
.btn-circular-badge {
  position: relative;
}

.btn-circular-badge::after {
  content: attr(data-count);
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  border: 2px solid var(--bg-primary);
  animation: badge-bounce 2s ease-in-out infinite;
}

/* ============================================
   BUTTON SIZE VARIANTS
   ============================================ */

/* Small */
.btn-neomorph-sm {
  padding: var(--btn-padding-sm);
  font-size: var(--font-sm);
  border-radius: var(--radius-md);
}

.btn-circular-sm {
  width: var(--btn-circular-sm);
  height: var(--btn-circular-sm);
}

.btn-circular-sm i {
  font-size: 1rem;
}

/* Large */
.btn-neomorph-lg {
  padding: var(--btn-padding-lg);
  font-size: var(--font-lg);
  border-radius: var(--radius-xl);
}

.btn-circular-lg {
  width: var(--btn-circular-lg);
  height: var(--btn-circular-lg);
}

.btn-circular-lg i {
  font-size: 1.8rem;
}

/* XL */
.btn-circular-xl {
  width: var(--btn-circular-xl);
  height: var(--btn-circular-xl);
}

.btn-circular-xl i {
  font-size: 2.5rem;
}

/* ============================================
   BUTTON STATES
   ============================================ */
.btn-neomorph:disabled,
.btn-neomorph-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] {
  /* Button shadows - Light theme */
  --btn-shadow-raised: 8px 8px 16px rgba(138, 43, 226, 0.15), -8px -8px 16px rgba(255, 255, 255, 0.9);
  --btn-shadow-hover: 12px 12px 24px rgba(138, 43, 226, 0.2), -12px -12px 24px rgba(255, 255, 255, 1);
  --btn-shadow-pressed: inset 4px 4px 8px rgba(138, 43, 226, 0.2), inset -4px -4px 8px rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .btn-neomorph {
  background: linear-gradient(145deg, #f0f0f5, #e0e0e8);
  box-shadow:
    var(--btn-shadow-raised),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .btn-neomorph:hover {
  background: linear-gradient(145deg, #e8e8f0, #d8d8e0);
  box-shadow:
    var(--btn-shadow-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .btn-neomorph:active {
  background: linear-gradient(145deg, #d8d8e0, #e0e0e8);
  box-shadow: var(--btn-shadow-pressed);
}

[data-theme="light"] .btn-neomorph-pressed {
  background: linear-gradient(145deg, #d8d8e0, #e8e8f0);
  box-shadow:
    inset 6px 6px 12px rgba(138, 43, 226, 0.15),
    inset -6px -6px 12px rgba(255, 255, 255, 0.7);
  color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .btn-neomorph-icon {
  background: linear-gradient(145deg, #f0f0f5, #e0e0e8);
  box-shadow:
    6px 6px 12px rgba(138, 43, 226, 0.15),
    -6px -6px 12px rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .btn-neomorph-icon:hover {
  box-shadow:
    8px 8px 16px rgba(138, 43, 226, 0.2),
    -8px -8px 16px rgba(255, 255, 255, 1);
}

[data-theme="light"] .btn-neomorph-icon:active {
  box-shadow:
    inset 3px 3px 6px rgba(138, 43, 226, 0.2),
    inset -3px -3px 6px rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .btn-circular-gradient {
  box-shadow:
    0 8px 24px rgba(138, 43, 226, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .btn-circular-gradient:hover {
  box-shadow:
    0 12px 36px rgba(138, 43, 226, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 50px rgba(138, 43, 226, 0.4);
}

[data-theme="light"] .btn-circular-glass {
  background: rgba(138, 43, 226, 0.1);
  border-color: rgba(138, 43, 226, 0.3);
  box-shadow:
    0 8px 32px rgba(138, 43, 226, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .btn-circular-glass:hover {
  background: rgba(138, 43, 226, 0.18);
  border-color: rgba(138, 43, 226, 0.5);
  box-shadow:
    0 12px 48px rgba(138, 43, 226, 0.25),
    0 0 60px rgba(138, 43, 226, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .btn-circular-glass i {
  background: linear-gradient(135deg, var(--primary-purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
