/* ==========================================
   NUNGO BUILDS CALM - ANIMATIONS
   ========================================== */

/* Fade In */
@keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  .fade-in {
    animation: fadeIn 0.5s ease-in-out;
  }
  
  /* Slide In From Right */
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  .slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
  }
  
  /* Slide In From Left */
  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  .slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
  }
  
  /* Slide In From Top */
  @keyframes slideInTop {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  .slide-in-top {
    animation: slideInTop 0.5s ease-in-out;
  }
  
  /* Slide In From Bottom */
  @keyframes slideInBottom {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  .slide-in-bottom {
    animation: slideInBottom 0.5s ease-in-out;
  }
  
  /* Scale In */
  @keyframes scaleIn {
    from {
      transform: scale(0.8);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  .scale-in {
    animation: scaleIn 0.5s ease-in-out;
  }
  
  /* Pulse */
  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
    100% {
      transform: scale(1);
    }
  }
  
  .pulse {
    animation: pulse 1.5s infinite;
  }
  
  /* Bounce */
  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-20px);
    }
    60% {
      transform: translateY(-10px);
    }
  }
  
  .bounce {
    animation: bounce 2s;
  }
  
  /* Shake */
  @keyframes shake {
    0%, 100% {
      transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
      transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
      transform: translateX(5px);
    }
  }
  
  .shake {
    animation: shake 0.5s;
  }
  
  /* Rotate */
  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  .rotate {
    animation: rotate 2s linear infinite;
  }
  
  /* Success Animation */
  .success-animation {
    display: flex;
    justify-content: center;
    margin: var(--spacing-xl) 0;
  }
  
  .success-animation i {
    font-size: 5rem;
    color: var(--success-color);
    animation: scaleIn 0.5s, pulse 1.5s 0.5s;
  }
  
  /* Mood Selection Animation */
  .mood-option.selected .mood-icon {
    animation: pulse 0.5s;
  }
  
  /* Modal Animation */
  .modal.active .modal-content {
    animation: scaleIn 0.3s;
  }
  
  /* Chat Message Animation */
  .message {
    animation: fadeIn 0.3s;
  }
  
  /* Page Transition Animations */
  .page-enter {
    opacity: 0;
    transform: translateY(20px);
  }
  
  .page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
  }
  
  .page-exit {
    opacity: 1;
  }
  
  .page-exit-active {
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  /* Loading Spinner */
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(91, 135, 249, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite;
  }
  
  .loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
  }
  
  /* Typing Indicator Animation */
  @keyframes typingDot {
    0% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-5px);
    }
    100% {
      transform: translateY(0);
    }
  }
  
  .typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--spacing-md);
    background-color: var(--bg-body);
    border-radius: var(--border-radius-md);
    width: fit-content;
  }
  
  .typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-light);
    border-radius: 50%;
  }
  
  .typing-dot:nth-child(1) {
    animation: typingDot 1s infinite 0s;
  }
  
  .typing-dot:nth-child(2) {
    animation: typingDot 1s infinite 0.2s;
  }
  
  .typing-dot:nth-child(3) {
    animation: typingDot 1s infinite 0.4s;
  }
  
  /* Save Button Animation */
  @keyframes saveProgress {
    0% {
      width: 0%;
    }
    100% {
      width: 100%;
    }
  }
  
  .save-button-progress {
    position: relative;
    overflow: hidden;
  }
  
  .save-button-progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.7);
    animation: saveProgress 2s linear;
  }
  
  /* Notification Badge Animation */
  @keyframes notificationPulse {
    0% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(232, 102, 113, 0.7);
    }
    70% {
      transform: scale(1.1);
      box-shadow: 0 0 0 5px rgba(232, 102, 113, 0);
    }
    100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(232, 102, 113, 0);
    }
  }
  
  .notification-badge {
    animation: notificationPulse 2s infinite;
  }
  
  /* Hover Animations */
  .hover-scale {
    transition: transform var(--transition-fast);
  }
  
  .hover-scale:hover {
    transform: scale(1.05);
  }
  
  .hover-elevate {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  }
  
  .hover-elevate:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }
  
  /* Button Animations */
  .primary-button, .secondary-button, .danger-button {
    position: relative;
    overflow: hidden;
  }
  
  .primary-button::after, .secondary-button::after, .danger-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
  }
  
  .primary-button:active::after, .secondary-button:active::after, .danger-button:active::after {
    width: 300px;
    height: 300px;
  }
  
  /* Chart Animation */
  @keyframes chartGrow {
    from {
      height: 0;
    }
    to {
      height: 100%;
    }
  }
  
  .chart-bar {
    animation: chartGrow 1s ease-out;
  }
  
  /* Theme Transition */
  body, *, *::before, *::after {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
  }