/* ============================================
   KRomper Animation & Design System
   Все анимации, декоративные элементы и единый стиль
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --glow-green: 0 0 20px rgba(162, 255, 0, 0.3);
  --glow-purple: 0 0 20px rgba(138, 43, 226, 0.3);
  --glow-red: 0 0 20px rgba(255, 68, 68, 0.3);
  --glow-white: 0 0 20px rgba(255, 255, 255, 0.15);

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.6);
}

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

/* Fade + Slide Up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered item entrance */
@keyframes staggerIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Spin for loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Slide in mobile menu */
@keyframes slideMenuIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */

.deco-grid {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(162, 255, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(162, 255, 0, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.deco-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

.deco-orb-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(162, 255, 0, 0.12), transparent 70%);
  top: -100px; right: -80px;
}

.deco-orb-2 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.1), transparent 70%);
  bottom: -80px; left: -80px;
}

/* ============================================
   ENTRANCE CLASSES
   ============================================ */

.animate-on-load {
  animation: fadeInUp 0.4s ease both;
}

.animate-on-load-delay-1 { animation-delay: 0.08s; }
.animate-on-load-delay-2 { animation-delay: 0.15s; }
.animate-on-load-delay-3 { animation-delay: 0.22s; }
.animate-on-load-delay-4 { animation-delay: 0.3s; }
.animate-on-load-delay-5 { animation-delay: 0.38s; }
.animate-on-load-delay-6 { animation-delay: 0.45s; }

.stagger-children > * {
  opacity: 0;
  animation: staggerIn 0.4s ease both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.24s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.27s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.3s; }

/* ============================================
   MODAL / WINDOW ANIMATIONS
   ============================================ */

.modal-overlay {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
}

.modal-window {
  opacity: 0;
  transform: scale(0.92) translateY(15px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

/* ============================================
   UNIFIED BUTTON SYSTEM
   ============================================ */

/* Base button - all buttons get this */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ---- Button Variants ---- */

/* Primary accent (green) */
.btn-primary {
  background: var(--accent);
  color: #000;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 14px;
}

.btn-primary:hover {
  background: #8cdf00;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 14px;
}

.btn-secondary:hover {
  background: #7a26cc;
}

/* Ghost / outline (green border) */
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 10px 26px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-ghost:hover {
  background: var(--accent);
  color: #000;
  box-shadow: var(--glow-green);
}

/* Ghost purple */
.btn-ghost-purple {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
  padding: 10px 26px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-ghost-purple:hover {
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--glow-purple);
}

/* Danger (red) */
.btn-danger {
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  border: 1px solid rgba(255, 68, 68, 0.3);
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-danger:hover {
  background: #ff4444;
  color: #fff;
  box-shadow: var(--glow-red);
  border-color: #ff4444;
}

/* Glass (transparent) */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--glow-white);
}

/* Pay button (large) */
.btn-pay {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 18px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.btn-pay:hover {
  background: #8cdf00;
  box-shadow: 0 0 25px rgba(162, 255, 0, 0.4);
  transform: translateY(-3px);
}

.btn-pay:active {
  transform: translateY(0) scale(0.98);
}

.btn-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Back / secondary link button */
.btn-back {
  background: none;
  border: 1px solid #333;
  color: #888;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn-back:hover {
  border-color: #555;
  color: #fff;
  transform: translateX(-4px);
}

/* Pill button (round) */
.btn-pill {
  border-radius: 50px;
  padding: 12px 30px;
}

/* Small button */
.btn-sm {
  padding: 6px 16px;
  font-size: 11px;
  border-radius: 8px;
}

/* Icon button (circular) */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ============================================
   INPUT FIELD ANIMATIONS
   ============================================ */

input, select, textarea {
  transition: all 0.3s var(--ease-out) !important;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(162, 255, 0, 0.1) !important;
  outline: none;
  transform: translateY(-1px);
}

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

/* Style cards (index.html) */
.style-card {
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease !important;
}

.style-card:hover {
  transform: translateY(-10px) scale(1.03) !important;
  box-shadow: 0 20px 40px rgba(162, 255, 0, 0.2) !important;
}



/* Class cards (catalog) — animation only, layout in style.css */

/* Class cards (my-classes) */
.class-card {
  transition: all 0.4s var(--ease-out) !important;
}

.class-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7) !important;
}

/* Stat boxes */
.stat-box {
  transition: all 0.4s var(--ease-out) !important;
}

.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

/* Profile card enhancements */
.profile-card {
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

/* Avatar glow effect */
.avatar-circle {
  transition: all 0.4s var(--ease-out);
}

.avatar-circle:hover {
  box-shadow: 0 0 25px rgba(162, 255, 0, 0.25);
}

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

.chat-msg {
  animation: fadeInUp 0.3s var(--ease-out) both;
}

.chat-dialog-item {
  transition: all 0.25s var(--ease-out) !important;
}

.chat-dialog-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.08) !important;
}

.chat-send-btn {
  transition: all 0.25s var(--ease-out) !important;
}

.chat-send-btn:hover {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 0 20px rgba(162, 255, 0, 0.4);
}

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

.main-navbar {
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.main-navbar:hover {
  background: rgba(0, 0, 0, 0.98);
}

.nav-menu.open {
  animation: slideMenuIn 0.3s var(--ease-out) both;
}

.nav-user {
  transition: all 0.3s var(--ease-out) !important;
}

.nav-user:hover {
  transform: translateY(-1px);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */



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

.tab {
  transition: all 0.3s var(--ease-out) !important;
}

.tab:hover {
  transform: translateY(-1px);
  opacity: 0.8;
}

.tab.active {
  transform: translateY(-2px) !important;
}

.tab.active:hover {
  opacity: 1;
}

/* ============================================
   FLOATING BUTTON
   ============================================ */

.floating-btn {
  transition: all 0.5s var(--ease-bounce) !important;
}

.floating-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.floating-btn:hover #btn-icon {
  transform: rotate(15deg) scale(1.2);
  transition: transform 0.3s var(--ease-bounce);
}

/* ============================================
   SHOW MORE BUTTON
   ============================================ */

.btn-show-more {
  transition: all 0.35s var(--ease-out) !important;
}

.btn-show-more:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================
   DASHBOARD BUTTON
   ============================================ */

.btn-dashboard {
  transition: all 0.35s var(--ease-out) !important;
}

.btn-dashboard:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 0 30px rgba(162, 255, 0, 0.2) !important;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
  transition: background 0.3s;
}

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

/* ============================================
   GLASS CARD DECORATION
   ============================================ */

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(162, 255, 0, 0.3), transparent);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(162, 255, 0, 0.15), transparent);
  margin: 40px 0;
  border: none;
}

.section-divider-purple {
  background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.15), transparent);
}

/* ============================================
   RESPONSIVE ANIMATION TWEAKS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
