/* Servisim — Sayfa geçiş animasyonları */

html { scroll-behavior: smooth; }

body[data-animations="1"] {
  animation: page-enter 0.45s ease both;
}

body[data-animations="1"].page-leaving {
  animation: page-leave 0.28s ease both;
}

body[data-transition="fade"][data-animations="1"] { animation-name: page-enter-fade; }
body[data-transition="slide"][data-animations="1"] { animation-name: page-enter-slide; }
body[data-transition="zoom"][data-animations="1"] { animation-name: page-enter-zoom; }
body[data-transition="flip"][data-animations="1"] { animation-name: page-enter-flip; }

body[data-transition="fade"][data-animations="1"].page-leaving { animation-name: page-leave-fade; }
body[data-transition="slide"][data-animations="1"].page-leaving { animation-name: page-leave-slide; }
body[data-transition="zoom"][data-animations="1"].page-leaving { animation-name: page-leave-zoom; }

@keyframes page-enter-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes page-leave-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes page-enter-slide {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes page-leave-slide {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-12px); }
}

@keyframes page-enter-zoom {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes page-leave-zoom {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(1.02); }
}

@keyframes page-enter-flip {
  from { opacity: 0; transform: perspective(800px) rotateX(6deg); }
  to { opacity: 1; transform: none; }
}

body[data-animations="1"] .panel-content > *,
body[data-animations="1"] .container > section,
body[data-animations="1"] .card {
  animation: block-rise 0.5s ease both;
}

body[data-animations="1"] .stat-grid .stat:nth-child(1) { animation-delay: 0.04s; }
body[data-animations="1"] .stat-grid .stat:nth-child(2) { animation-delay: 0.08s; }
body[data-animations="1"] .stat-grid .stat:nth-child(3) { animation-delay: 0.12s; }
body[data-animations="1"] .stat-grid .stat:nth-child(4) { animation-delay: 0.16s; }

body[data-animations="1"] .app-grid .app-tile {
  animation: block-rise 0.45s ease both;
}

body[data-animations="1"] .app-grid .app-tile:nth-child(1) { animation-delay: 0.02s; }
body[data-animations="1"] .app-grid .app-tile:nth-child(2) { animation-delay: 0.04s; }
body[data-animations="1"] .app-grid .app-tile:nth-child(3) { animation-delay: 0.06s; }
body[data-animations="1"] .app-grid .app-tile:nth-child(4) { animation-delay: 0.08s; }
body[data-animations="1"] .app-grid .app-tile:nth-child(5) { animation-delay: 0.1s; }
body[data-animations="1"] .app-grid .app-tile:nth-child(6) { animation-delay: 0.12s; }

@keyframes block-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

body[data-animations="1"] .app-popup__dialog {
  animation: popup-enter 0.32s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes popup-enter {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

body[data-animations="0"] *:not(.sidebar-nav):not(.sidebar-nav *),
body[data-animations="0"] *:not(.sidebar-nav):not(.sidebar-nav *)::before,
body[data-animations="0"] *:not(.sidebar-nav):not(.sidebar-nav *)::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  body[data-animations="1"] { animation: none; }
  body[data-animations="1"] * { animation: none !important; }
}

@media (max-width: 1024px) {
  body[data-animations="1"] .app-popup__dialog {
    animation: popup-enter-mobile 0.28s ease both;
  }
  @keyframes popup-enter-mobile {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
}
