/* ============================================
   FUTURISTIC FX — NEXT-GEN MOTION EFFECTS
   Level: Blade Runner 2049 / Interstellar HUD
   ============================================ */

/* ======== 1. HOLOGRAPHIC GRID BACKGROUND ======== */
[data-theme="dark"] .cc-dashboard::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    /* Holographic grid floor */
    linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  perspective: 500px;
  transform: rotateX(60deg) translateY(-50%);
  transform-origin: center bottom;
  animation: fx-grid-drift 20s linear infinite;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  mask-image: linear-gradient(transparent 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(transparent 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

@keyframes fx-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 40px, 0 0; }
}

/* ======== 2. ENERGY PULSE ON PANELS ======== */
.cc-panel {
  --pulse-pos: -100%;
}

.cc-panel .cc-panel-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--pulse-pos);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cc-neon), var(--cc-teal), transparent);
  animation: fx-energy-pulse 4s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes fx-energy-pulse {
  0% { left: -60px; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { left: calc(100% + 60px); opacity: 0; }
}

/* ======== 3. HOLOGRAPHIC SHIMMER ON CARDS ======== */
.cc-gauge-card::after,
.cc-ai-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(0, 240, 255, 0.03) 45%,
    rgba(0, 240, 255, 0.06) 50%,
    rgba(0, 240, 255, 0.03) 55%,
    transparent 60%
  );
  animation: fx-hologram-shimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fx-hologram-shimmer {
  0% { transform: translate(-30%, -30%) rotate(0deg); }
  50% { transform: translate(30%, 30%) rotate(3deg); }
  100% { transform: translate(-30%, -30%) rotate(0deg); }
}

/* ======== 4. BREATHING GLOW — SIDEBAR ACTIVE ======== */
[data-theme="dark"] .sidebar-item.active {
  animation: fx-active-breathe 3s ease-in-out infinite;
}

@keyframes fx-active-breathe {
  0%, 100% {
    box-shadow: inset 3px 0 0 var(--cc-neon), 0 0 8px rgba(0, 240, 255, 0.1), 0 0 20px rgba(0, 240, 255, 0.05);
  }
  50% {
    box-shadow: inset 3px 0 0 var(--cc-neon), 0 0 15px rgba(0, 240, 255, 0.2), 0 0 40px rgba(0, 240, 255, 0.1);
  }
}

/* ======== 5. NEON BORDER CHASE ======== */
.cc-status-bar {
  background-image: 
    linear-gradient(var(--cc-bg-panel), var(--cc-bg-panel)),
    linear-gradient(var(--angle, 0deg), var(--cc-neon), var(--cc-teal), var(--cc-purple), var(--cc-neon));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 1px solid transparent !important;
  animation: fx-border-chase 8s linear infinite;
}

@keyframes fx-border-chase {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

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

/* ======== 6. 3D HOVER TILT ======== */
.cc-gauge-card,
.cc-ai-card,
.cc-threat-metric {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  perspective: 800px;
}

.cc-gauge-card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateY(-2deg) !important;
  box-shadow: 
    0 0 10px rgba(0, 240, 255, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.3),
    inset 0 0 30px rgba(0, 240, 255, 0.03) !important;
}

.cc-ai-card:hover {
  transform: translateX(4px) scale(1.01);
  box-shadow: 
    0 0 15px rgba(0, 240, 255, 0.15),
    4px 4px 30px rgba(0, 0, 0, 0.2);
}

/* ======== 7. TYPEWRITER STATUS VALUES ======== */
.cc-status-value {
  overflow: hidden;
  animation: fx-typewriter-glow 3s ease-in-out infinite;
}

@keyframes fx-typewriter-glow {
  0%, 100% { text-shadow: 0 0 4px rgba(0, 240, 255, 0.3); }
  50% { text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(0, 240, 255, 0.2); }
}

/* ======== 8. RADAR ORBITAL RING ======== */
.cc-radar-container::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.15);
  animation: fx-orbit-spin 30s linear infinite;
}

.cc-radar-container::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px dashed rgba(10, 255, 219, 0.08);
  animation: fx-orbit-spin 45s linear infinite reverse;
}

@keyframes fx-orbit-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ======== 9. CLOCK DIGITAL FLICKER ======== */
.cc-clock {
  animation: fx-clock-flicker 5s step-end infinite;
  position: relative;
}

.cc-clock::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  width: 2px;
  height: 60%;
  transform: translateY(-50%);
  background: var(--cc-neon);
  animation: fx-cursor-blink 1s step-end infinite;
  opacity: 0.6;
}

@keyframes fx-clock-flicker {
  0% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  95% { opacity: 0.5; }
  96% { opacity: 1; }
  100% { opacity: 1; }
}

@keyframes fx-cursor-blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0; }
}

/* ======== 10. PROJECT ROW SCAN LINE ======== */
.cc-project-row {
  position: relative;
  overflow: hidden;
}

.cc-project-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.05), transparent);
  transition: left 0.6s ease;
}

.cc-project-row:hover::before {
  left: 100%;
}

/* ======== 11. GAUGE COUNTER ANIMATION ======== */
.cc-gauge-value {
  animation: fx-number-glow 4s ease-in-out infinite;
}

@keyframes fx-number-glow {
  0%, 100% { 
    text-shadow: 0 0 5px rgba(232, 244, 255, 0.2);
    filter: brightness(1);
  }
  50% { 
    text-shadow: 0 0 15px rgba(232, 244, 255, 0.4), 0 0 30px rgba(0, 240, 255, 0.15);
    filter: brightness(1.1);
  }
}

/* ======== 12. PANEL SCAN REVEAL ======== */
.cc-panel {
  animation: fx-panel-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes fx-panel-reveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(4px);
  }
  60% {
    opacity: 0.8;
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.cc-panel:nth-child(1) { animation-delay: 0.1s; }
.cc-panel:nth-child(2) { animation-delay: 0.2s; }
.cc-panel:nth-child(3) { animation-delay: 0.3s; }
.cc-panel:nth-child(4) { animation-delay: 0.4s; }
.cc-panel:nth-child(5) { animation-delay: 0.5s; }
.cc-panel:nth-child(6) { animation-delay: 0.6s; }

/* ======== 13. THREAT LEVEL PULSATING RING ======== */
.cc-threat-level {
  position: relative;
}

.cc-threat-level::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.15;
  animation: fx-threat-ring 2s ease-out infinite;
}

@keyframes fx-threat-ring {
  0% { width: 60px; height: 60px; opacity: 0.3; }
  100% { width: 120px; height: 120px; opacity: 0; }
}

/* ======== 14. AI BADGE SPARK ======== */
.cc-ai-badge {
  position: relative;
  overflow: hidden;
}

.cc-ai-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: fx-badge-spark 3s ease-in-out infinite;
}

@keyframes fx-badge-spark {
  0%, 70% { left: -50%; }
  100% { left: 150%; }
}

/* ======== 15. SIDEBAR LOGO ROTATING RING ======== */
[data-theme="dark"] .sidebar-logo-icon {
  position: relative;
  overflow: visible;
}

[data-theme="dark"] .sidebar-logo-icon::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--cc-neon);
  border-right-color: var(--cc-teal);
  animation: fx-logo-orbit 6s linear infinite;
  opacity: 0.4;
}

@keyframes fx-logo-orbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ======== 16. TERMINAL CURSOR BLINK ======== */
.cc-terminal::after {
  content: '█';
  color: var(--cc-neon);
  font-family: var(--cc-font-mono);
  font-size: 0.7rem;
  animation: fx-terminal-blink 1s step-end infinite;
  opacity: 0.6;
}

@keyframes fx-terminal-blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0; }
}

/* ======== 17. SMOOTH PAGE TRANSITIONS ======== */
[data-theme="dark"] .page-content {
  animation: fx-page-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fx-page-enter {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px) brightness(0.8);
  }
  40% {
    filter: blur(1px) brightness(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0) brightness(1);
  }
}

/* ======== 18. BUTTON ENERGY CHARGE ======== */
[data-theme="dark"] .btn-primary {
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

[data-theme="dark"] .btn-primary:hover::after {
  transform: translateX(100%);
}

[data-theme="dark"] .btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4) !important;
}

/* ======== 19. GAUGE FILL GLOW PULSE ======== */
.cc-gauge-fill {
  animation: fx-gauge-glow 3s ease-in-out infinite;
}

@keyframes fx-gauge-glow {
  0%, 100% { filter: drop-shadow(0 0 3px var(--gauge-color, var(--cc-neon))); }
  50% { filter: drop-shadow(0 0 8px var(--gauge-color, var(--cc-neon))) drop-shadow(0 0 15px var(--gauge-color, var(--cc-neon))); }
}

/* ======== 20. HEADER SCAN LINE ======== */
[data-theme="dark"] .header {
  overflow: hidden;
}

[data-theme="dark"] .header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.02), transparent);
  animation: fx-header-scan 8s linear infinite;
  pointer-events: none;
}

@keyframes fx-header-scan {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ======== 21. NOTIFICATION BELL WAVE ======== */
[data-theme="dark"] .header-right .fa-bell {
  animation: fx-bell-wave 4s ease-in-out infinite;
}

@keyframes fx-bell-wave {
  0%, 90%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(12deg); }
  94% { transform: rotate(-10deg); }
  96% { transform: rotate(6deg); }
  98% { transform: rotate(-3deg); }
}

/* ======== 22. DOT CONSTELLATION ======== */
.cc-project-dot {
  animation: fx-dot-twinkle 3s ease-in-out infinite;
  animation-delay: calc(var(--dot-index, 0) * 0.3s);
}

@keyframes fx-dot-twinkle {
  0%, 100% { box-shadow: 0 0 3px currentColor; transform: scale(1); }
  50% { box-shadow: 0 0 8px currentColor, 0 0 15px currentColor; transform: scale(1.3); }
}

.cc-project-row:nth-child(1) .cc-project-dot { --dot-index: 0; }
.cc-project-row:nth-child(2) .cc-project-dot { --dot-index: 1; }
.cc-project-row:nth-child(3) .cc-project-dot { --dot-index: 2; }
.cc-project-row:nth-child(4) .cc-project-dot { --dot-index: 3; }
.cc-project-row:nth-child(5) .cc-project-dot { --dot-index: 4; }
.cc-project-row:nth-child(6) .cc-project-dot { --dot-index: 5; }

/* ======== 23. PROGRESS BAR SHIMMER ======== */
.cc-project-progress-fill,
[data-theme="dark"] .progress-bar-fill {
  position: relative;
  overflow: hidden;
}

.cc-project-progress-fill::after,
[data-theme="dark"] .progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: fx-progress-shimmer 2.5s ease-in-out infinite;
}

@keyframes fx-progress-shimmer {
  0% { left: -60%; }
  100% { left: 160%; }
}

/* ======== 24. GLASS REFRACTION EDGE ======== */
.cc-panel {
  box-shadow:
    0 1px 0 rgba(0, 240, 255, 0.05) inset,
    0 -1px 0 rgba(0, 240, 255, 0.02) inset,
    0 4px 20px rgba(0, 0, 0, 0.2);
}

.cc-panel:hover {
  box-shadow:
    0 1px 0 rgba(0, 240, 255, 0.1) inset,
    0 -1px 0 rgba(0, 240, 255, 0.04) inset,
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(0, 240, 255, 0.05);
  transition: box-shadow 0.5s ease;
}

/* ======== 25. CALENDAR CELL MICRO-ANIMATION ======== */
[data-theme="dark"] .calendar-day {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .calendar-day:hover {
  background: rgba(0, 240, 255, 0.06) !important;
  transform: scale(1.05);
  border-color: var(--cc-border-active) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

/* ======== 26. SIDEBAR HOVER GLOW TRAIL ======== */
[data-theme="dark"] .sidebar-item {
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .sidebar-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), transparent);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}

[data-theme="dark"] .sidebar-item:hover::after {
  width: 100%;
}

/* ======== 27. LOADING SCREEN ENHANCED ======== */
[data-theme="dark"] .loading-shield {
  animation: fx-shield-pulse 2s ease-in-out infinite;
}

@keyframes fx-shield-pulse {
  0%, 100% {
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.8), 0 0 80px rgba(0, 240, 255, 0.2);
    transform: scale(1.05);
  }
}

[data-theme="dark"] .loading-bar-container {
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .loading-bar-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: fx-loading-sweep 1.5s ease-in-out infinite;
}

@keyframes fx-loading-sweep {
  0% { left: -60%; }
  100% { left: 160%; }
}

/* ======== 28. TOAST SLIDE + GLOW ======== */
[data-theme="dark"] .toast {
  animation: fx-toast-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fx-toast-enter {
  0% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
    filter: blur(4px);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

/* ======== 29. MODAL HOLOGRAM OPEN ======== */
[data-theme="dark"] .modal-content {
  animation: fx-modal-hologram 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fx-modal-hologram {
  0% {
    transform: scale(0.85) perspective(500px) rotateX(5deg);
    opacity: 0;
    filter: blur(6px) brightness(2);
    box-shadow: 0 0 80px rgba(0, 240, 255, 0.3);
  }
  60% {
    filter: blur(1px) brightness(1.2);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
  }
  100% {
    transform: scale(1) perspective(500px) rotateX(0deg);
    opacity: 1;
    filter: blur(0) brightness(1);
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.1);
  }
}

/* ======== 30. AMBIENT LIGHT SWEEP ======== */
[data-theme="dark"] .main-area::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse 600px 300px at var(--mouse-x, 50%) var(--mouse-y, 30%), rgba(0, 240, 255, 0.015), transparent);
  pointer-events: none;
  z-index: 0;
  transition: background 0.3s ease;
}
