/* ============================================================
   Teymensel Support — Animations Library
   ============================================================ */

/* ============================================================
   AURORA / GRADIENT MESH BACKGROUND
   ============================================================ */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: auroraFloat var(--duration, 12s) ease-in-out infinite alternate;
}

.aurora-blob:nth-child(1) {
  width: 700px;
  height: 700px;
  background: var(--primary);
  top: -200px;
  left: -100px;
  --duration: 14s;
}

.aurora-blob:nth-child(2) {
  width: 600px;
  height: 600px;
  background: var(--purple);
  top: 30%;
  right: -150px;
  --duration: 11s;
  animation-delay: -5s;
}

.aurora-blob:nth-child(3) {
  width: 500px;
  height: 500px;
  background: #1a6b4f;
  bottom: -100px;
  left: 40%;
  --duration: 16s;
  animation-delay: -8s;
}

@keyframes auroraFloat {
  0%   { transform: translate(0, 0) rotate(0deg)   scale(1); }
  33%  { transform: translate(40px, -30px) rotate(5deg)   scale(1.05); }
  66%  { transform: translate(-20px, 20px)  rotate(-3deg) scale(0.97); }
  100% { transform: translate(20px, -10px)  rotate(2deg)  scale(1.02); }
}

/* ============================================================
   ANIMATED GRADIENT BORDER
   ============================================================ */
.animated-border {
  position: relative;
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(var(--angle, 0deg), var(--primary), var(--purple), var(--primary));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  animation: rotateBorder 4s linear infinite;
  pointer-events: none;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateBorder {
  to { --angle: 360deg; }
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-enter {
  animation: pageEnter 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-fade {
  animation: pageFade 300ms ease forwards;
}

@keyframes pageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   FLOATING ANIMATION
   ============================================================ */
.floating {
  animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.floating-slow {
  animation: floating 6s ease-in-out infinite;
}

/* ============================================================
   PULSE / GLOW ANIMATIONS
   ============================================================ */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { box-shadow: 0 0 24px 8px var(--primary-glow); }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ============================================================
   SPIN / LOADER
   ============================================================ */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loading-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-ring-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* ============================================================
   BOUNCE ANIMATIONS
   ============================================================ */
@keyframes bounceIn {
  0%   { transform: scale(0.8);   opacity: 0; }
  70%  { transform: scale(1.04);  opacity: 1; }
  100% { transform: scale(1);     opacity: 1; }
}

.bounce-in {
  animation: bounceIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================================
   SLIDE ANIMATIONS
   ============================================================ */
@keyframes slideInLeft {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes slideInDown {
  from { transform: translateY(-24px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.slide-in-left  { animation: slideInLeft  350ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-in-right { animation: slideInRight 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-in-up    { animation: slideInUp    350ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-in-down  { animation: slideInDown  350ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Stagger helpers */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }
.stagger-7 { animation-delay: 350ms; }
.stagger-8 { animation-delay: 400ms; }

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PROGRESS BAR ANIMATION
   ============================================================ */
.progress-animated .progress-bar {
  animation: fillBar 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  width: 0% !important;
}

@keyframes fillBar {
  to { width: var(--target-width, 100%); }
}

/* ============================================================
   CARD HOVER 3D EFFECT
   ============================================================ */
.card-3d {
  transform-style: preserve-3d;
  transition: transform var(--transition);
}

/* ============================================================
   MAGNETIC BUTTON
   ============================================================ */
.btn-magnetic {
  transition: transform var(--transition-fast);
}

/* ============================================================
   RIPPLE EFFECT
   ============================================================ */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0);
  animation: rippleAnim 600ms linear;
  pointer-events: none;
  margin-left: -50px;
  margin-top: -50px;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================
   GLOW HOVER EFFECT
   ============================================================ */
.hover-glow {
  transition: box-shadow var(--transition-fast);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--primary-glow);
}

.hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   MOUSE GLOW EFFECT
   ============================================================ */
.mouse-glow-container {
  position: relative;
  overflow: hidden;
}

.mouse-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 200ms;
}

.mouse-glow-container:hover .mouse-glow { opacity: 1; }

/* ============================================================
   NOTIFICATION BELL ANIMATION
   ============================================================ */
.bell-ring {
  animation: bellRing 0.5s ease-in-out;
  transform-origin: top center;
}

@keyframes bellRing {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(15deg); }
  40%  { transform: rotate(-12deg); }
  60%  { transform: rotate(8deg); }
  80%  { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

/* ============================================================
   AI THINKING ANIMATION
   ============================================================ */
.ai-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: fit-content;
}

.ai-thinking-dot {
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  animation: aiThink 1.4s ease-in-out infinite;
}

.ai-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiThink {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1.1); opacity: 1; }
}

/* ============================================================
   STATUS PULSE
   ============================================================ */
.status-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.status-pulse-dot.operational { background: var(--success); }
.status-pulse-dot.partial_outage { background: var(--warning); }
.status-pulse-dot.major_outage { background: var(--danger); }

.status-pulse-dot.operational::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: statusPulseRing 2s ease-out infinite;
}

@keyframes statusPulseRing {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 400ms ease, visibility 400ms ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 0 40px var(--primary-glow);
  animation: floating 2s ease-in-out infinite;
}

.loading-bar-container {
  width: 200px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 16px;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  animation: loadingFill 1.5s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes loadingFill {
  0%   { width: 0%;    margin-left: 0%; }
  50%  { width: 60%;   margin-left: 20%; }
  100% { width: 0%;    margin-left: 100%; }
}

/* ============================================================
   REDUCED MOTION (Accessibility)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
}

/* ============================================================
   DRAG & DROP
   ============================================================ */
.drag-over {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ============================================================
   TICKET STATUS TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-5);
}

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-main);
  background: var(--border);
}

.timeline-dot.active { background: var(--primary); }
.timeline-dot.success { background: var(--success); }
.timeline-dot.warning { background: var(--warning); }
.timeline-dot.danger  { background: var(--danger); }

.timeline-content { }
.timeline-time {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================
   CODE COPY BUTTON
   ============================================================ */
.code-block {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.code-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.code-copy-btn.copied { color: var(--success); border-color: rgba(34,197,94,0.3); }
