/* ================================================
   WINDOWS VIRUS + HACKED — Animation Cybersécurité
   Préfixe: wv- (évite conflits thème)
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Exo+2:wght@400;600;700&display=swap');

:root {
  --wv-cyan: #00e5ff;
  --wv-red: #ff3250;
  --wv-green: #22c55e;
  --wv-dark: #0a0a1a;
}

/* Wrapper with rectangular fade */
.wv-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-composite: destination-in;
  mask-image:
    linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-composite: intersect;
}

/* Screen container */
.wv-screen {
  position: relative;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1b4f72 0%, #1a3c5e 40%, #1e5078 100%);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 60px rgba(0,0,0,0.7), 0 0 80px rgba(0,229,255,0.04);
  font-family: 'Segoe UI', -apple-system, sans-serif;
}

/* Desktop icons */
.wv-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  z-index: 2;
}
.wv-icon-img {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.wv-icon-name {
  font-size: 10px;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  text-align: center;
  max-width: 70px;
}

/* Taskbar */
.wv-taskbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 5;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.wv-start {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: white;
}
.wv-start-logo {
  width: 16px; height: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.wv-start-sq { width: 7px; height: 7px; background: #0078d4; }
.wv-start-sq-blue { background: #00a4ef; }
.wv-start-sq-green { background: #7fba00; }
.wv-start-sq-yellow { background: #ffb900; }

.wv-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}
.wv-tray-alert {
  animation: wv-blink 0.8s ease-in-out infinite;
  color: var(--wv-red);
  font-weight: bold;
  display: none;
}
.wv-tray-alert.wv-visible { display: inline; }

@keyframes wv-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Popups */
.wv-popup {
  position: absolute;
  z-index: 10;
  background: #1c1c1c;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: wv-pop-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wv-pop-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.wv-popup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}
.wv-popup-bar-error {
  background: rgba(255,50,80,0.15);
  border-bottom: 1px solid rgba(255,50,80,0.2);
}
.wv-popup-bar-warning {
  background: rgba(245,158,11,0.15);
  border-bottom: 1px solid rgba(245,158,11,0.2);
}
.wv-popup-bar-critical {
  background: rgba(255,50,80,0.3);
  border-bottom: 1px solid rgba(255,50,80,0.4);
}
.wv-popup-x {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  border-radius: 3px;
}
.wv-popup-body {
  padding: 12px 14px;
  display: flex;
  gap: 12px;
}
.wv-popup-icon { font-size: 28px; }
.wv-popup-text {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  white-space: pre-line;
}
.wv-popup-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 14px 10px;
}
.wv-popup-btn {
  padding: 5px 20px;
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
}
.wv-popup-critical .wv-popup-btn {
  background: rgba(255,50,80,0.2);
  border-color: rgba(255,50,80,0.3);
  color: var(--wv-red);
}

/* BSOD */
.wv-bsod {
  position: absolute; inset: 0; z-index: 50;
  background: #0078d4;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: wv-fade-in 0.15s ease-out;
}
.wv-bsod.wv-visible { display: flex; }

@keyframes wv-fade-in { from { opacity: 0; } to { opacity: 1; } }

.wv-bsod-sad { font-size: 72px; margin-bottom: 16px; color: white; }
.wv-bsod-title { font-size: 20px; color: white; margin-bottom: 14px; }
.wv-bsod-text {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  line-height: 1.7;
  max-width: 400px;
  margin-bottom: 24px;
}
.wv-bsod-code {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}
.wv-bsod-pct {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

/* HACKED screen */
.wv-hacked {
  position: absolute; inset: 0; z-index: 55;
  background: #000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: wv-fade-in 0.3s ease-out;
}
.wv-hacked.wv-visible { display: flex; }

.wv-hacked::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    transparent 0px, transparent 2px,
    rgba(34,197,94,0.02) 2px, rgba(34,197,94,0.02) 4px);
  z-index: 1;
}

.wv-scanbar {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(180deg, transparent, rgba(34,197,94,0.07), transparent);
  z-index: 2;
  animation: wv-scan 3s linear infinite;
  pointer-events: none;
}
@keyframes wv-scan { from { top: -3px; } to { top: 100%; } }

.wv-hacked-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.wv-hacked-scroll::-webkit-scrollbar { width: 0; }

/* Art mode: center HACKED art */
.wv-hacked-scroll.wv-art-mode {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.wv-hart-container {
  text-align: center;
}
.wv-hart-container.wv-drift-up {
  animation: wv-drift-up 3.5s linear forwards;
}
@keyframes wv-drift-up {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(-180px); opacity: 0; }
}

.wv-hline {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre;
  color: var(--wv-green);
  text-shadow: 0 0 6px rgba(34,197,94,0.25);
  animation: wv-hline-in 0.06s ease-out;
}
.wv-hline-dim {
  color: rgba(34,197,94,0.35);
  text-shadow: none;
}
@keyframes wv-hline-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.wv-hart {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 1px;
  font-weight: bold;
  white-space: pre;
  color: var(--wv-green);
  text-shadow: 0 0 15px rgba(34,197,94,0.5),
    0 0 40px rgba(34,197,94,0.2),
    0 0 80px rgba(34,197,94,0.1);
}

.wv-cursor {
  display: inline-block;
  width: 9px; height: 15px;
  background: var(--wv-green);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: wv-cur-blink 1s step-end infinite;
}
@keyframes wv-cur-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Chaos flicker */
.wv-screen.wv-chaos::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,50,80,0.03);
  pointer-events: none;
  z-index: 1;
  animation: wv-rpulse 1.5s ease-in-out infinite;
}
@keyframes wv-rpulse { 0%,100%{opacity:0}50%{opacity:1} }

.wv-screen.wv-chaos {
  animation: wv-fl 0.15s steps(2) infinite;
}
@keyframes wv-fl { 0%{opacity:1}50%{opacity:.97}100%{opacity:1} }

/* Ambient glow */
.wv-glow {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  border-radius: 20px;
  transition: background 1s;
}

/* Responsive */
@media (max-width: 768px) {
  .wv-wrapper {
    max-width: 100% !important;
  }

  .wv-screen {
    max-width: 100%;
    border-radius: 6px;
  }

  /* Repositionner les icônes en pourcentage via scale */
  .wv-icon {
    transform-origin: top left;
    transform: scale(0.65);
  }

  .wv-icon-img { font-size: 24px; }
  .wv-icon-name { font-size: 8px; max-width: 55px; }

  /* Les popups ne doivent pas déborder */
  .wv-popup {
    transform: rotate(0deg) !important;
    max-width: 70% !important;
  }
  .wv-popup-body { padding: 8px 10px; gap: 8px; }
  .wv-popup-icon { font-size: 22px; }
  .wv-popup-text { font-size: 9px; }
  .wv-popup-bar { font-size: 9px; padding: 5px 8px; }
  .wv-popup-btn { font-size: 9px; padding: 4px 14px; }

  /* BSOD */
  .wv-bsod { padding: 20px; }
  .wv-bsod-sad { font-size: 40px; margin-bottom: 10px; }
  .wv-bsod-title { font-size: 14px; }
  .wv-bsod-text { font-size: 9px; max-width: 90%; }
  .wv-bsod-code { font-size: 8px; }
  .wv-bsod-pct { font-size: 10px; }

  /* Hacked */
  .wv-hart { font-size: 8px; letter-spacing: 0; }
  .wv-hline { font-size: 9px; }
  .wv-hacked-scroll { padding: 12px; }

  /* Taskbar */
  .wv-taskbar { height: 28px; }
  .wv-start { font-size: 9px; padding: 2px 6px; }
  .wv-tray { font-size: 8px; gap: 6px; }
}

@media (max-width: 480px) {
  .wv-icon {
    transform: scale(0.5);
  }
  .wv-icon-img { font-size: 20px; }
  .wv-icon-name { font-size: 7px; max-width: 48px; }
  .wv-popup { max-width: 65% !important; }
  .wv-hart { font-size: 5px; }
  .wv-hline { font-size: 7px; }
  .wv-bsod-sad { font-size: 32px; }
  .wv-bsod-title { font-size: 12px; }
  .wv-taskbar { height: 24px; }
}
