/* =============================================================================
   File        : public/assets/css/frontend/alerts.css
   Project     : GyanPeeth Academy
   Framework   : CodeIgniter 4

   Description
   -----------------------------------------------------------------------------
   Global Alert System

   Contents

   1. Alert Wrapper
   2. Base Alert
   3. Icons
   4. Content
   5. Close Button
   6. Variants
   7. Animation

=============================================================================*/

/* =============================================================================
   ALERT WRAPPER
============================================================================= */

.fe-flash-wrapper {
  width: 100%;

  margin: 1.5rem 0;
}

.fe-flash-wrapper:first-child {
  margin-top: 2rem;
}

/* =============================================================================
   BASE ALERT
============================================================================= */

.fe-alert {
  position: relative;

  display: flex;

  align-items: flex-start;

  gap: 1rem;

  width: 100%;

  padding: 1rem 1.25rem;

  border-radius: 18px;

  border: 1px solid transparent;

  overflow: hidden;

  box-shadow: var(--fe-shadow-sm);

  transition: var(--fe-transition);
}

.fe-alert:hover {
  transform: translateY(-2px);

  box-shadow: var(--fe-shadow-md);
}

/* =============================================================================
   ALERT ICON
============================================================================= */

.fe-alert-icon {
  flex-shrink: 0;

  width: 48px;

  height: 48px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 14px;

  font-size: 1.2rem;
}

/* =============================================================================
   ALERT CONTENT
============================================================================= */

.fe-alert-content {
  flex: 1;

  font-size: 0.95rem;

  line-height: 1.7;

  font-weight: 500;
}

.fe-alert-content h4 {
  margin: 0 0 0.35rem;

  font-size: 1rem;

  font-weight: 700;
}

.fe-alert-content p {
  margin: 0;
}

/* =============================================================================
   CLOSE BUTTON
============================================================================= */

.fe-alert-close {
  width: 36px;

  height: 36px;

  display: flex;

  align-items: center;

  justify-content: center;

  margin-left: auto;

  border-radius: 12px;

  cursor: pointer;

  transition: var(--fe-transition);
}

.fe-alert-close:hover {
  background: rgba(0, 0, 0, 0.06);
}
/* =============================================================================
   SUCCESS ALERT
============================================================================= */

.fe-alert-success {
  color: #166534;

  background: #f0fdf4;

  border-color: #bbf7d0;
}

.fe-alert-success .fe-alert-icon {
  color: #16a34a;

  background: #dcfce7;
}

/* =============================================================================
   DANGER ALERT
============================================================================= */

.fe-alert-danger {
  color: #991b1b;

  background: #fef2f2;

  border-color: #fecaca;
}

.fe-alert-danger .fe-alert-icon {
  color: #dc2626;

  background: #fee2e2;
}

/* =============================================================================
   WARNING ALERT
============================================================================= */

.fe-alert-warning {
  color: #92400e;

  background: #fffbeb;

  border-color: #fde68a;
}

.fe-alert-warning .fe-alert-icon {
  color: #d97706;

  background: #fef3c7;
}

/* =============================================================================
   INFO ALERT
============================================================================= */

.fe-alert-info {
  color: #1e40af;

  background: #eff6ff;

  border-color: #bfdbfe;
}

.fe-alert-info .fe-alert-icon {
  color: #2563eb;

  background: #dbeafe;
}

/* =============================================================================
   PRIMARY ALERT
============================================================================= */

.fe-alert-primary {
  color: #1e3a8a;

  background: #eef4ff;

  border-color: #93c5fd;
}

.fe-alert-primary .fe-alert-icon {
  color: #2563eb;

  background: #dbeafe;
}

/* =============================================================================
   LEFT BORDER STYLE
============================================================================= */

.fe-alert-border {
  border-left: 6px solid currentColor;
}

/* =============================================================================
   GLASS ALERT
============================================================================= */

.fe-alert-glass {
  backdrop-filter: blur(18px);

  -webkit-backdrop-filter: blur(18px);

  background: rgba(255, 255, 255, 0.75);
}

/* =============================================================================
   TOAST STYLE
============================================================================= */

.fe-alert-toast {
  max-width: 420px;

  margin-left: auto;

  border-radius: 20px;
}

/* =============================================================================
   ALERT ANIMATION
============================================================================= */

.fe-alert {
  animation: feAlertFade 0.45s ease;
}

@keyframes feAlertFade {
  from {
    opacity: 0;

    transform: translateY(-20px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* =============================================================================
   CLOSE ANIMATION
============================================================================= */

.fe-alert.is-closing {
  opacity: 0;

  transform: translateY(-20px);

  transition: 0.35s ease;
}

/* =============================================================================
   DARK MODE
============================================================================= */

[data-theme="dark"] .fe-alert {
  color: #f8fafc;

  background: rgba(30, 41, 59, 0.95);

  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .fe-alert-success .fe-alert-icon {
  background: rgba(34, 197, 94, 0.18);

  color: #4ade80;
}

[data-theme="dark"] .fe-alert-danger .fe-alert-icon {
  background: rgba(239, 68, 68, 0.18);

  color: #f87171;
}

[data-theme="dark"] .fe-alert-warning .fe-alert-icon {
  background: rgba(245, 158, 11, 0.18);

  color: #fbbf24;
}

[data-theme="dark"] .fe-alert-info .fe-alert-icon {
  background: rgba(59, 130, 246, 0.18);

  color: #60a5fa;
}

/* =============================================================================
   RESPONSIVE
============================================================================= */

@media (max-width: 768px) {
  .fe-alert {
    padding: 1rem;

    gap: 0.85rem;
  }

  .fe-alert-icon {
    width: 42px;

    height: 42px;

    font-size: 1rem;
  }

  .fe-alert-content {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .fe-alert {
    flex-direction: column;

    align-items: flex-start;
  }

  .fe-alert-close {
    position: absolute;

    top: 0.75rem;

    right: 0.75rem;
  }
}

/* =============================================================================
   REDUCED MOTION
============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .fe-alert {
    animation: none;

    transition: none;
  }
}
