/**
 * Ágape Cursos - Custom Styles
 * Animações, componentes reutilizáveis e estilos complementares ao Tailwind
 */

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.scale-in {
  animation: scaleIn 0.4s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Stagger animations for lists */
.stagger-animation>* {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.stagger-animation>*:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-animation>*:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-animation>*:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-animation>*:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-animation>*:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-animation>*:nth-child(6) {
  animation-delay: 0.6s;
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

.agape-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.agape-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.agape-notification-success {
  background: #10b981;
  color: white;
}

.agape-notification-error {
  background: #ef4444;
  color: white;
}

.agape-notification-warning {
  background: #f59e0b;
  color: white;
}

.agape-notification-info {
  background: #3b82f6;
  color: white;
}

.agape-notification .material-symbols-outlined {
  font-size: 24px;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */

[data-modal] {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

[data-modal].active {
  display: flex;
}

[data-modal-overlay] {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

[data-modal-content] {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dark [data-modal-content] {
  background: #2a1d17;
}

/* Video Modal specific */
.video-modal [data-modal-content] {
  max-width: 1200px;
  padding: 0;
  background: #000;
}

.video-modal iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
}

.dark .form-input,
.dark .form-textarea,
.dark .form-select {
  background: #2a1d17;
  border-color: #3a251e;
  color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #D9808E;
  box-shadow: 0 0 0 3px rgba(217, 128, 142, 0.1);
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #ef4444;
}

.form-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-success {
  color: #10b981;
  font-size: 14px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Floating label effect */
.form-floating {
  position: relative;
}

.form-floating label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 0 4px;
  color: #9ca3af;
  transition: all 0.3s ease;
  pointer-events: none;
}

.dark .form-floating label {
  background: #2a1d17;
}

.form-floating input:focus+label,
.form-floating input:not(:placeholder-shown)+label {
  top: 0;
  font-size: 12px;
  color: #D9808E;
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

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

.btn-primary {
  background: #D9808E;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #B65C6A;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(217, 128, 142, 0.3);
}

.btn-secondary {
  background: #4F2630;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #3a1b24;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid #D9808E;
  color: #D9808E;
}

.btn-outline:hover:not(:disabled) {
  background: #D9808E;
  color: white;
}

.btn-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.dark .card {
  background: #2a1d17;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  border-color: #D9808E;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
  background: linear-gradient(90deg,
      #f0f0f0 0%,
      #e0e0e0 50%,
      #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.dark .skeleton {
  background: linear-gradient(90deg,
      #2a1d17 0%,
      #3a251e 50%,
      #2a1d17 100%);
  background-size: 200% 100%;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top-color: #D9808E;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   BADGE / PILL
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: rgba(217, 128, 142, 0.1);
  color: #D9808E;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.dark .progress-bar {
  background: #3a251e;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D9808E, #B65C6A);
  border-radius: 9999px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: shimmer 2s infinite;
}

/* ============================================
   TOOLTIP
   ============================================ */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: #1f2937;
  color: white;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-gradient {
  background: linear-gradient(135deg, #D9808E, #B65C6A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-effect {
  background: rgba(42, 29, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
  background: #2a1d17;
}

::-webkit-scrollbar-thumb {
  background: #D9808E;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #B65C6A;
}

/* Hide scrollbar for specific elements */
.scrollbar-hidden {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}

/* ============================================
   RESPONSIVE HELPERS
   ============================================ */

@media (max-width: 768px) {
  .agape-notification {
    right: 10px;
    left: 10px;
    top: 10px;
  }

  [data-modal-content] {
    max-width: 100%;
    margin: 0;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #D9808E;
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #D9808E;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}