/* =============================================================================
   File        : public/assets/css/frontend/buttons.css
   Project     : GyanPeeth Academy
   Framework   : CodeIgniter 4

   Description
   -----------------------------------------------------------------------------
   Global Button System

   Contents

   1. Base Button
   2. Sizes
   3. Icons
   4. States
   5. Loading
   6. Responsive

=============================================================================*/

/* =============================================================================
   BUTTON RESET
============================================================================= */

.fe-btn {
  --btn-height: 52px;

  --btn-radius: 16px;

  --btn-padding: 0 1.6rem;

  position: relative;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 0.75rem;

  height: var(--btn-height);

  padding: var(--btn-padding);

  border: none;

  border-radius: var(--btn-radius);

  font-family: "Poppins", sans-serif;

  font-size: 0.95rem;

  font-weight: 600;

  line-height: 1;

  text-decoration: none;

  cursor: pointer;

  user-select: none;

  white-space: nowrap;

  transition: all 0.3s ease;

  overflow: hidden;
}

/* =============================================================================
   BUTTON ICON
============================================================================= */

.fe-btn i {
  font-size: 1rem;

  flex-shrink: 0;
}

.fe-btn svg {
  width: 18px;

  height: 18px;
}

/* =============================================================================
   BUTTON HOVER
============================================================================= */

.fe-btn:hover {
  transform: translateY(-3px);
}

.fe-btn:active {
  transform: translateY(0);
}

/* =============================================================================
   FOCUS
============================================================================= */

.fe-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);

  outline-offset: 3px;
}

/* =============================================================================
   DISABLED
============================================================================= */

.fe-btn:disabled,
.fe-btn.disabled {
  opacity: 0.6;

  cursor: not-allowed;

  pointer-events: none;
}

/* =============================================================================
   FULL WIDTH
============================================================================= */

.fe-btn-block {
  width: 100%;
}

/* =============================================================================
   BUTTON SIZES
============================================================================= */

.fe-btn-xs {
  --btn-height: 34px;

  font-size: 0.75rem;

  padding: 0 0.8rem;
}

.fe-btn-sm {
  --btn-height: 42px;

  font-size: 0.88rem;

  padding: 0 1rem;
}

.fe-btn-md {
  --btn-height: 52px;
}

.fe-btn-lg {
  --btn-height: 60px;

  font-size: 1rem;

  padding: 0 2rem;
}

.fe-btn-xl {
  --btn-height: 68px;

  font-size: 1.1rem;

  padding: 0 2.6rem;
}

/* =============================================================================
   ICON ONLY
============================================================================= */

.fe-btn-icon {
  width: 52px;

  height: 52px;

  padding: 0;
}

.fe-btn-icon-sm {
  width: 42px;

  height: 42px;
}

.fe-btn-icon-lg {
  width: 62px;

  height: 62px;
}

/* =============================================================================
   PRIMARY BUTTON
============================================================================= */

.fe-btn-primary {
  color: #fff;

  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);

  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.fe-btn-primary:hover {
  color: #fff;

  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

/* =============================================================================
   SECONDARY BUTTON
============================================================================= */

.fe-btn-secondary {
  color: #fff;

  background: linear-gradient(135deg, var(--color-secondary), #ea580c);

  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.28);
}

.fe-btn-secondary:hover {
  color: #fff;

  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.35);
}

/* =============================================================================
   OUTLINE BUTTON
============================================================================= */

.fe-btn-outline {
  color: var(--color-primary);

  background: transparent;

  border: 1.5px solid var(--color-primary);
}

.fe-btn-outline:hover {
  color: #fff;

  background: var(--color-primary);
}

/* =============================================================================
   SOFT BUTTON
============================================================================= */

.fe-btn-soft {
  color: var(--color-primary);

  background: rgba(37, 99, 235, 0.08);
}

.fe-btn-soft:hover {
  background: var(--color-primary);

  color: #fff;
}

/* =============================================================================
   GHOST BUTTON
============================================================================= */

.fe-btn-ghost {
  color: var(--color-text);

  background: transparent;
}

.fe-btn-ghost:hover {
  background: rgba(37, 99, 235, 0.08);

  color: var(--color-primary);
}

/* =============================================================================
   SUCCESS BUTTON
============================================================================= */

.fe-btn-success {
  color: #fff;

  background: var(--color-success);
}

.fe-btn-success:hover {
  background: #16a34a;
}

/* =============================================================================
   DANGER BUTTON
============================================================================= */

.fe-btn-danger {
  color: #fff;

  background: var(--color-danger);
}

.fe-btn-danger:hover {
  background: #dc2626;
}

/* =============================================================================
   WARNING BUTTON
============================================================================= */

.fe-btn-warning {
  color: #fff;

  background: var(--color-warning);
}

.fe-btn-warning:hover {
  background: #d97706;
}

/* =============================================================================
   DARK BUTTON
============================================================================= */

.fe-btn-dark {
  color: #fff;

  background: var(--color-dark);
}

.fe-btn-dark:hover {
  background: #020617;
}

/* =============================================================================
   WHITE BUTTON
============================================================================= */

.fe-btn-white {
  color: var(--color-dark);

  background: #fff;

  border: 1px solid var(--color-border);
}

.fe-btn-white:hover {
  background: #f8fafc;
}

/* =============================================================================
   WHATSAPP BUTTON
============================================================================= */

.fe-btn-whatsapp {
  color: #fff;

  background: #25d366;
}

.fe-btn-whatsapp:hover {
  background: #128c7e;

  color: #fff;
}

/* =============================================================================
   GLASS BUTTON
============================================================================= */

.fe-btn-glass {
  color: var(--color-heading);

  background: rgba(255, 255, 255, 0.65);

  border: 1px solid rgba(255, 255, 255, 0.25);

  backdrop-filter: blur(16px);

  -webkit-backdrop-filter: blur(16px);
}

.fe-btn-glass:hover {
  background: #fff;
}

/* =============================================================================
   GRADIENT BUTTON
============================================================================= */

.fe-btn-gradient {
  color: #fff;

  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-secondary)
  );
}

.fe-btn-gradient:hover {
  color: #fff;

  filter: brightness(1.05);
}

/* =============================================================================
   BUTTON SHINE EFFECT
============================================================================= */

.fe-btn {
  isolation: isolate;
}

.fe-btn::before {
  content: "";

  position: absolute;

  top: 0;

  left: -120%;

  width: 80%;

  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );

  transform: skewX(-25deg);

  transition: left 0.8s ease;

  pointer-events: none;
}

.fe-btn:hover::before {
  left: 140%;
}

/* =============================================================================
   RIPPLE EFFECT
============================================================================= */

.fe-btn {
  overflow: hidden;
}

.fe-btn .fe-ripple {
  position: absolute;

  border-radius: 50%;

  transform: scale(0);

  background: rgba(255, 255, 255, 0.35);

  animation: feRipple 0.6s linear;

  pointer-events: none;
}

@keyframes feRipple {
  to {
    transform: scale(4);

    opacity: 0;
  }
}

/* =============================================================================
   BUTTON LOADING
============================================================================= */

.fe-btn-loading {
  pointer-events: none;

  cursor: wait;

  opacity: 0.85;
}

.fe-btn-loading i {
  display: none;
}

.fe-btn-loading::after {
  content: "";

  width: 18px;

  height: 18px;

  border-radius: 50%;

  border: 2px solid rgba(255, 255, 255, 0.35);

  border-top-color: #fff;

  animation: feSpin 0.8s linear infinite;
}

@keyframes feSpin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================================
   BUTTON GROUP
============================================================================= */

.fe-btn-group {
  display: inline-flex;

  align-items: center;

  gap: 0.75rem;

  flex-wrap: wrap;
}

.fe-btn-group .fe-btn {
  flex: 0 0 auto;
}

/* =============================================================================
   ICON HELPERS
============================================================================= */

.fe-btn-icon-left {
  display: inline-flex;

  align-items: center;

  gap: 0.65rem;
}

.fe-btn-icon-right {
  display: inline-flex;

  align-items: center;

  gap: 0.65rem;

  flex-direction: row-reverse;
}

/* =============================================================================
   FLOATING BUTTON
============================================================================= */

.fe-btn-floating {
  width: 60px;

  height: 60px;

  padding: 0;

  border-radius: 50%;

  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.fe-btn-floating:hover {
  transform: translateY(-6px) scale(1.05);
}

/* =============================================================================
   PULSE BUTTON
============================================================================= */

.fe-btn-pulse {
  animation: fePulse 2s infinite;
}

@keyframes fePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  }

  70% {
    box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* =============================================================================
   BADGE INSIDE BUTTON
============================================================================= */

.fe-btn-badge {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  min-width: 20px;

  height: 20px;

  padding: 0 0.45rem;

  border-radius: 999px;

  font-size: 0.72rem;

  font-weight: 700;

  background: #fff;

  color: var(--color-primary);
}

/* =============================================================================
   DARK MODE
============================================================================= */

[data-theme="dark"] .fe-btn-outline {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .fe-btn-white {
  color: #fff;

  background: rgba(255, 255, 255, 0.08);

  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .fe-btn-glass {
  background: rgba(255, 255, 255, 0.06);

  border-color: rgba(255, 255, 255, 0.08);

  color: #fff;
}

/* =============================================================================
   RESPONSIVE
============================================================================= */

@media (max-width: 768px) {
  .fe-btn {
    --btn-height: 48px;

    font-size: 0.9rem;
  }

  .fe-btn-lg {
    --btn-height: 56px;
  }

  .fe-btn-xl {
    --btn-height: 60px;
  }

  .fe-btn-group {
    width: 100%;

    flex-direction: column;
  }

  .fe-btn-group .fe-btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .fe-btn {
    width: 100%;
  }

  .fe-btn-icon {
    width: 48px;

    height: 48px;
  }
}

/* =============================================================================
   REDUCED MOTION
============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .fe-btn,
  .fe-btn::before {
    animation: none !important;

    transition: none !important;
  }
}
