/* ============================================
   ZERO DEFENCE PRO - BUTTONS LIBRARY
   Version: 2.0.0 | Comprehensive Button System
   Complete CSS File - Ready to Use
   ============================================ */

/* --------------------------------------------
   CSS VARIABLES (Fallback values if root not set)
   -------------------------------------------- */
:root {
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --bg-dark: #0a0a0a;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;
  --primary-cyan: #00ffff;
  --primary-blue: #0088ff;
  --primary-green: #00ff88;
  --gradient-primary: linear-gradient(135deg, #00ffff, #0088ff, #00ff88);
  --gradient-danger: linear-gradient(95deg, #dc2626, #f97316);
  --gradient-success: linear-gradient(95deg, #10b981, #34d399);
  --z-sticky: 100;
}

/* --------------------------------------------
   1. BASE BUTTON STYLES
   -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 12px 28px;
  font-family: 'Orbitron', 'Inter', monospace;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  background: transparent;
  color: var(--text-white);
}

/* Button Content */
.btn-content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Button Ripple Effect */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
  transform: scale(0);
  pointer-events: none;
  animation: btnRipple 0.6s ease-out;
}

@keyframes btnRipple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* --------------------------------------------
   2. BUTTON VARIANTS
   -------------------------------------------- */
/* Primary Button */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 255, 0.3);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--primary-cyan);
  border: 2px solid var(--primary-cyan);
}

.btn-secondary:hover {
  background: rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

/* Danger Button */
.btn-danger {
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Success Button */
.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--text-white);
  border: 2px solid rgba(0, 255, 255, 0.3);
}

.btn-outline:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  transform: translateY(-2px);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-gray);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

/* Gradient Button */
.btn-gradient {
  background: var(--gradient-primary);
  background-size: 200% auto;
  color: var(--bg-dark);
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background-position: right center;
  transform: translateY(-2px);
}

/* Glass Button */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-cyan);
}

/* --------------------------------------------
   3. BUTTON SIZES
   -------------------------------------------- */
/* Extra Small */
.btn-xs {
  padding: 6px 14px;
  font-size: 0.7rem;
  gap: var(--spacing-xs);
}

/* Small */
.btn-sm {
  padding: 8px 20px;
  font-size: 0.8rem;
  gap: var(--spacing-sm);
}

/* Medium (Default) */
.btn-md {
  padding: 12px 28px;
  font-size: 0.875rem;
}

/* Large */
.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
}

/* Extra Large */
.btn-xl {
  padding: 16px 44px;
  font-size: 1.125rem;
}

/* 2X Large */
.btn-2xl {
  padding: 20px 56px;
  font-size: 1.25rem;
}

/* Full Width Button */
.btn-full {
  width: 100%;
  display: flex;
}

/* --------------------------------------------
   4. BUTTON WITH ICONS
   -------------------------------------------- */
.btn-icon-left .btn-content i {
  margin-right: var(--spacing-sm);
}

.btn-icon-right .btn-content i {
  margin-left: var(--spacing-sm);
}

.btn-icon-only {
  padding: 12px;
  border-radius: var(--radius-md);
}

.btn-icon-only .btn-content {
  gap: 0;
}

.btn-icon-only.btn-xs {
  padding: 6px;
}

.btn-icon-only.btn-sm {
  padding: 8px;
}

.btn-icon-only.btn-lg {
  padding: 14px;
}

.btn-icon-only.btn-xl {
  padding: 16px;
}

/* --------------------------------------------
   5. BUTTON STATES
   -------------------------------------------- */
/* Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading .btn-content {
  opacity: 0;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes btnSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Disabled State */
.btn-disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Active State */
.btn-active {
  transform: scale(0.98);
}

/* Focus State */
.btn:focus-visible {
  outline: 2px solid var(--primary-cyan);
  outline-offset: 2px;
}

/* --------------------------------------------
   6. BUTTON GROUPS
   -------------------------------------------- */
.btn-group {
  display: inline-flex;
  position: relative;
  flex-wrap: wrap;
}

.btn-group .btn {
  border-radius: 0;
  margin: 0 -1px 0 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-full);
  border-bottom-left-radius: var(--radius-full);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-full);
  border-bottom-right-radius: var(--radius-full);
}

.btn-group-vertical {
  display: inline-flex;
  flex-direction: column;
}

.btn-group-vertical .btn {
  border-radius: 0;
  margin: -1px 0 0 0;
}

.btn-group-vertical .btn:first-child {
  border-top-left-radius: var(--radius-full);
  border-top-right-radius: var(--radius-full);
}

.btn-group-vertical .btn:last-child {
  border-bottom-left-radius: var(--radius-full);
  border-bottom-right-radius: var(--radius-full);
}

/* --------------------------------------------
   7. SPECIAL EFFECTS
   -------------------------------------------- */
/* Neon Button */
.btn-neon {
  background: transparent;
  color: var(--primary-cyan);
  border: 2px solid var(--primary-cyan);
  box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.btn-neon:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* 3D Button */
.btn-3d {
  position: relative;
  transform-style: preserve-3d;
}

.btn-3d::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  bottom: -4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: inherit;
  z-index: -1;
  filter: blur(4px);
}

.btn-3d:active {
  transform: translateY(2px);
}

.btn-3d:active::before {
  top: 2px;
  bottom: -2px;
}

/* Pulse Button */
.btn-pulse {
  animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 255, 255, 0);
  }
}

/* Gradient Border Button */
.btn-border-gradient {
  position: relative;
  background: var(--bg-dark);
  border: none;
}

.btn-border-gradient::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.btn-border-gradient:hover::before {
  opacity: 1;
}

/* Shine Button */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 200%;
  height: 200%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(25deg);
  transition: left 0.5s ease;
}

.btn-shine:hover::after {
  left: 100%;
}

/* Cyber Button (with glitch effect) */
.btn-cyber {
  background: transparent;
  color: var(--primary-cyan);
  border: 2px solid var(--primary-cyan);
  position: relative;
  text-transform: uppercase;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  transition: all 0.2s;
}

.btn-cyber:hover {
  background: var(--primary-cyan);
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--primary-cyan);
}

/* --------------------------------------------
   8. SOCIAL BUTTONS
   -------------------------------------------- */
.btn-telegram {
  background: #0088cc;
  color: white;
}

.btn-telegram:hover {
  background: #0099dd;
  transform: translateY(-2px);
}

.btn-twitter {
  background: #1da1f2;
  color: white;
}

.btn-twitter:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
}

.btn-discord {
  background: #5865f2;
  color: white;
}

.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.btn-github {
  background: #333;
  color: white;
}

.btn-github:hover {
  background: #242424;
  transform: translateY(-2px);
}

.btn-instagram {
  background: linear-gradient(45deg, #f09433, #d62976, #962fbf);
  color: white;
}

.btn-instagram:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* --------------------------------------------
   9. FLOATING ACTION BUTTONS
   -------------------------------------------- */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
  transition: all var(--transition-normal);
  z-index: var(--z-sticky);
  border: none;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4);
}

.fab-sm {
  width: 40px;
  height: 40px;
}

.fab-lg {
  width: 64px;
  height: 64px;
}

.fab-xl {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

/* FAB Menu (Expandable) */
.fab-menu {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: var(--z-sticky);
}

.fab-menu .fab {
  position: relative;
  bottom: auto;
  right: auto;
}

.fab-menu-items {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

.fab-menu.open .fab-menu-items {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-menu-item {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.fab-menu-item:hover {
  transform: scale(1.1);
  background: var(--primary-cyan);
  color: var(--bg-dark);
}

/* --------------------------------------------
   10. TOGGLE BUTTONS
   -------------------------------------------- */
.btn-toggle {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.btn-toggle.active {
  background: var(--gradient-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Toggle Switch Button */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  transition: var(--transition-normal);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: var(--primary-cyan);
  border-radius: 50%;
  transition: var(--transition-normal);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gradient-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(30px);
  background: white;
}

/* --------------------------------------------
   ADDITIONAL UTILITIES
   -------------------------------------------- */
/* Button Stack (Vertical layout) */
.btn-stack {
  display: inline-flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Button with Badge */
.btn-badge {
  position: relative;
}

.btn-badge .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gradient-danger);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: bold;
}

/* Responsive Button Adjustments */
@media (max-width: 768px) {
  .btn-xl {
    padding: 14px 32px;
    font-size: 1rem;
  }
  
  .btn-2xl {
    padding: 16px 40px;
    font-size: 1.125rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    border-radius: var(--radius-full);
    margin: 2px 0;
  }
  
  .btn-group .btn:first-child,
  .btn-group .btn:last-child {
    border-radius: var(--radius-full);
  }
  
  .fab {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }
  
  .fab-lg {
    width: 56px;
    height: 56px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-pulse,
  .btn-shine::after,
  .btn-ripple {
    animation: none !important;
    transition: none !important;
  }
  
  .btn-pulse {
    box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.4);
  }
}