/* =============================================
   Kuaförim App - Animations & Transitions
   ============================================= */

/* Page transitions */
.page-enter {
  animation: pageSlideIn 0.3s ease forwards;
}

.page-exit {
  animation: pageSlideOut 0.3s ease forwards;
}

@keyframes pageSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pageSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-30%); opacity: 0; }
}

/* Fade */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Slide up (for modals/sheets) */
.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-down {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

/* Scale in */
.scale-in {
  animation: scaleIn 0.2s ease forwards;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Bounce */
.bounce-in {
  animation: bounceIn 0.4s ease forwards;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Heart beat */
@keyframes heartBeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

.heart-beat {
  animation: heartBeat 0.6s ease;
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.4s, opacity 0.6s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* Toast notification */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  max-width: calc(var(--max-width) - 32px);
  width: calc(100% - 32px);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast .toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }

.toast .toast-content {
  flex: 1;
  font-size: var(--font-sm);
}

/* Bottom sheet / Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: var(--z-modal);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: var(--max-width);
  max-height: 85vh;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bottom-sheet .sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: var(--space-sm) auto;
  flex-shrink: 0;
}

.bottom-sheet .sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.bottom-sheet .sheet-header h3 {
  font-size: var(--font-md);
  font-weight: var(--font-weight-bold);
}

.bottom-sheet .sheet-close {
  font-size: 20px;
  padding: var(--space-xs);
}

.bottom-sheet .sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  padding-bottom: calc(var(--safe-bottom) + var(--space-md));
}

/* Comments sheet */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comment-item {
  display: flex;
  gap: var(--space-sm);
}

.comment-item .comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.comment-item .comment-body {
  flex: 1;
}

.comment-item .comment-name {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-bold);
  margin-bottom: 2px;
}

.comment-item .comment-text {
  font-size: var(--font-sm);
  line-height: 1.4;
  margin-bottom: 4px;
}

.comment-item .comment-meta {
  font-size: var(--font-xs);
  color: var(--text-muted);
  display: flex;
  gap: var(--space-md);
}

.comment-item .comment-like {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-left: var(--space-sm);
}

.comment-item .comment-like i {
  font-size: 16px;
  color: var(--text-muted);
}

.comment-item .comment-like.liked i {
  color: var(--danger);
}

.comment-item .comment-like span {
  font-size: 10px;
  color: var(--text-muted);
}

/* Comment input */
.comment-input-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-color);
}

.comment-input-area .my-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.comment-input-area input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.comment-input-area .post-comment-btn {
  color: var(--primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-sm);
}

.comment-input-area .post-comment-btn:disabled {
  color: var(--text-muted);
}
