/* Artelink Global Styles */
/* Última atualização: Dezembro 2025 */

:root {
    --mobile-width: 375px;
    --mobile-max-width: 480px;
}

/* RemixIcon Override - Ensures proper icon display */
:where([class^="ri-"])::before { 
  content: "\f3c2"; 
}

/* Mobile-first responsive layout */
html {
    background-color: #e5e7eb;
    display: flex;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scrollbar-gutter: stable;
}

body {
    max-width: var(--mobile-max-width);
    width: 100%;
    min-height: 100vh;
    background-color: #f9fafb;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
    margin: 0 auto !important;
}

/* Desktop: Enhanced styling */
@media (min-width: 481px) {
    html {
        min-height: 100vh;
    }
    
    body {
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    }
}

/* Constrain fixed elements to mobile width and center them */
nav.fixed,
.fixed.top-0,
.fixed.bottom-0 {
    max-width: var(--mobile-max-width);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* Constrain floating buttons to mobile width */
button.fixed,
a.fixed {
    left: auto !important;
    right: calc(50% - var(--mobile-max-width)/2 + 1rem) !important;
    transform: none !important;
    max-width: none;
}

/* Modals and overlays - full screen but content centered */
.fixed.inset-0,
.modal-backdrop {
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
}

.fixed.inset-0 > div {
    max-width: var(--mobile-max-width);
    margin: 0 auto;
}

/* =============================================
   MODAL SYSTEM - Animações suaves para modais
   ============================================= */

/* Backdrop/overlay animation */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  transition: background-color 0.3s ease;
  overflow-y: auto;
}

.modal-backdrop.active {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.bottom-sheet {
  align-items: flex-end;
}

/* Modal content animation */
.modal-content {
  background: white;
  border-radius: 0.75rem;
  width: 100%;
  max-width: calc(var(--mobile-max-width) - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Bottom sheet modal variant */
.modal-backdrop.bottom-sheet .modal-content {
  border-radius: 1rem 1rem 0 0;
  max-width: var(--mobile-max-width);
  transform: translateY(100%);
  margin-bottom: 0;
}

.modal-backdrop.bottom-sheet.active .modal-content {
  transform: translateY(0);
}

/* Modal closing animation */
.modal-backdrop.closing {
  background-color: rgba(0, 0, 0, 0);
}

.modal-backdrop.closing .modal-content {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
}

.modal-backdrop.bottom-sheet.closing .modal-content {
  transform: translateY(100%);
}

/* Ensure modal fits within viewport */
.modal-content-scroll {
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* =============================================
   TOAST NOTIFICATIONS - Sistema de notificações
   ============================================= */

.toast-notification {
  position: fixed;
  top: 5rem;
  left: 1rem;
  right: 1rem;
  max-width: calc(var(--mobile-max-width) - 2rem);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
  z-index: 60;
  transform: translateY(-150%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification.success {
  background-color: #10B981;
  color: white;
}

.toast-notification.error {
  background-color: #EF4444;
  color: white;
}

.toast-notification.warning {
  background-color: #F59E0B;
  color: white;
}

.toast-notification.info {
  background-color: #3B82F6;
  color: white;
}

.toast-notification.primary {
  background-color: #FF6B35;
  color: white;
}

/* =============================================
   BUTTON INTERACTIONS - Animações de botões
   ============================================= */

button, a, .interactive {
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}

button:active:not(:disabled), 
a:active, 
.interactive:active {
  transform: scale(0.96);
}

/* Ripple effect for buttons */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
}

.ripple:active::after {
  width: 200%;
  height: 200%;
  opacity: 0;
}

/* =============================================
   CARD INTERACTIONS - Animações de cards
   ============================================= */

.card-interactive {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

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

.card-interactive:active {
  transform: translateY(0);
}

/* =============================================
   SKELETON LOADING - Estados de carregamento
   ============================================= */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* =============================================
   TYPING INDICATOR - Indicador de digitação
   ============================================= */

.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  background-color: #9CA3AF;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* =============================================
   PROGRESS BAR ANIMATION - Barras de progresso
   ============================================= */

.progress-bar {
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-bar.animated {
  animation: progress-pulse 2s infinite;
}

@keyframes progress-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* =============================================
   TOGGLE SWITCH - Interruptores
   ============================================= */

.toggle-switch {
  width: 3rem;
  height: 1.5rem;
  background-color: #D1D5DB;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-switch.active {
  background-color: #FF6B35;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 50%;
  top: 0.125rem;
  left: 0.125rem;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
  transform: translateX(1.5rem);
}

/* =============================================
   FADE IN ANIMATIONS - Sistema unificado
   ============================================= */

.fade-in {
  --fade-y: 0;
  --fade-scale: 1;
  animation: fadeIn 0.3s ease forwards;
}

.fade-in-up {
  --fade-y: 20px;
  --fade-scale: 1;
  animation: fadeIn 0.4s ease forwards;
}

.fade-in-scale {
  --fade-y: 0;
  --fade-scale: 0.9;
  animation: fadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(var(--fade-y, 0)) scale(var(--fade-scale, 1));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =============================================
   PULSE ANIMATION - Animação de pulso
   ============================================= */

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Badge pulse for notifications */
.badge-pulse {
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* =============================================
   SCROLL BEHAVIOR - Comportamento de scroll
   ============================================= */

.scroll-smooth {
  scroll-behavior: smooth;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

/* =============================================
   IMAGE LOADING - Carregamento de imagens
   ============================================= */

img {
  transition: opacity 0.3s ease;
}

img.loading {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

/* Image placeholder */
.img-placeholder {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   FORM ELEMENTS - Elementos de formulário
   ============================================= */

input, textarea, select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #FF6B35 !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* =============================================
   HEART LIKE ANIMATION - Animação de curtida
   ============================================= */

.like-animation {
  animation: likeHeart 0.3s ease;
}

@keyframes likeHeart {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* =============================================
   STAGGER ANIMATION - Animação em sequência
   ============================================= */

.stagger-item {
  --index: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.4s ease forwards;
  animation-delay: calc(var(--index) * 0.05s);
}

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

/* =============================================
   SAFE AREA ADJUSTMENTS - Ajustes de área segura
   ============================================= */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  nav.fixed.bottom-0 {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
