﻿/**
 * -------------------------------------------------------------------------------
 * ICONS 3D ULTRA-MODERN SYSTEM — AdventureNET
 * -------------------------------------------------------------------------------
 * 
 * Sistem de iconițe SVG 3D futuriste cu tehnici de depth și volum:
 * - Fara culori noi (doar currentColor + opacități)
 * - Layered depth: shadow + base + highlight
 * - Efecte hover premium: tilt magnetic, specular sweep, depth morph
 * - Respectă prefers-reduced-motion
 * 
 * ARHITECTURA SVG 3D:
 * +---------------------------------+
 * |  .icon3d-highlight (specular)  |  → alb/currentColor, opacity 0.08-0.18
 * +---------------------------------|
 * |  .icon3d-base (forma vizibila) |  → currentColor sau stroke="currentColor"
 * +---------------------------------|
 * |  .icon3d-shadow (depth layer)  |  → opacity 0.18-0.30, offset subtil
 * +---------------------------------+
 * -------------------------------------------------------------------------------
 */

/* -------------------------------------------------------------------------------
   DESIGN TOKENS — DEPTH & VOLUME
   ------------------------------------------------------------------------------- */

:root {
  /* Depth tokens */
  --icon3d-shadow-opacity: 0.22;
  --icon3d-highlight-opacity: 0.14;
  --icon3d-shadow-offset-x: 0.5px;
  --icon3d-shadow-offset-y: 1px;
  
  /* Size scale */
  --icon3d-size-xs: 0.875rem;   /* 14px */
  --icon3d-size-sm: 1.125rem;   /* 18px */
  --icon3d-size-md: 1.5rem;     /* 24px */
  --icon3d-size-lg: 2rem;       /* 32px */
  --icon3d-size-xl: 2.5rem;     /* 40px */
  --icon3d-size-2xl: 3rem;      /* 48px */
  --icon3d-size-3xl: 4rem;      /* 64px */
  
  /* Animation tokens */
  --icon3d-transition-fast: 120ms cubic-bezier(0.22, 1, 0.36, 1);
  --icon3d-transition-normal: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --icon3d-transition-slow: 280ms cubic-bezier(0.22, 1, 0.36, 1);
  
  /* 3D perspective for tilt effect */
  --icon3d-perspective: 400px;
  --icon3d-tilt-angle: 4deg;
}

/* Dark mode adjustments */
[data-mode="dark"] {
  --icon3d-shadow-opacity: 0.28;
  --icon3d-highlight-opacity: 0.18;
}

/* -------------------------------------------------------------------------------
   BASE ICON CONTAINER
   ------------------------------------------------------------------------------- */

.icon3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  
  width: var(--icon3d-size-md);
  height: var(--icon3d-size-md);
  
  /* 3D context */
  perspective: var(--icon3d-perspective);
  transform-style: preserve-3d;
  
  /* Smooth transitions */
  transition: transform var(--icon3d-transition-normal);
}

.icon3d svg {
  width: 100%;
  height: 100%;
  display: block;
  
  /* Vector non-scaling stroke for crisp lines */
  vector-effect: non-scaling-stroke;
  
  /* Hardware acceleration */
  transform: translateZ(0);
  will-change: transform;
  
  transition: 
    transform var(--icon3d-transition-normal),
    filter var(--icon3d-transition-normal);
}

/* -------------------------------------------------------------------------------
   SIZE VARIANTS
   ------------------------------------------------------------------------------- */

.icon3d--xs { width: var(--icon3d-size-xs); height: var(--icon3d-size-xs); }
.icon3d--sm { width: var(--icon3d-size-sm); height: var(--icon3d-size-sm); }
.icon3d--md { width: var(--icon3d-size-md); height: var(--icon3d-size-md); }
.icon3d--lg { width: var(--icon3d-size-lg); height: var(--icon3d-size-lg); }
.icon3d--xl { width: var(--icon3d-size-xl); height: var(--icon3d-size-xl); }
.icon3d--2xl { width: var(--icon3d-size-2xl); height: var(--icon3d-size-2xl); }
.icon3d--3xl { width: var(--icon3d-size-3xl); height: var(--icon3d-size-3xl); }

/* -------------------------------------------------------------------------------
   SVG LAYER CLASSES — DEPTH ARCHITECTURE
   ------------------------------------------------------------------------------- */

/* Shadow layer — creates depth perception */
.icon3d-shadow {
  opacity: var(--icon3d-shadow-opacity);
  transform: translate(var(--icon3d-shadow-offset-x), var(--icon3d-shadow-offset-y));
  transition: 
    opacity var(--icon3d-transition-normal),
    transform var(--icon3d-transition-normal);
}

/* Base layer — main visible shape */
.icon3d-base {
  /* Inherits currentColor from parent */
  color: inherit;
}

/* Highlight/specular layer — abstract light reflection */
.icon3d-highlight {
  opacity: var(--icon3d-highlight-opacity);
  transition: opacity var(--icon3d-transition-normal);
}

/* -------------------------------------------------------------------------------
   DEPTH LEVELS — DROP SHADOW TECHNIQUE
   ------------------------------------------------------------------------------- */

.icon3d--depth-1 svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.icon3d--depth-2 svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.16));
}

.icon3d--depth-3 svg {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.20));
}

/* Dark mode depth adjustments */
[data-mode="dark"] .icon3d--depth-1 svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

[data-mode="dark"] .icon3d--depth-2 svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.32));
}

[data-mode="dark"] .icon3d--depth-3 svg {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.40));
}

/* -------------------------------------------------------------------------------
   HOVER EFFECT A: MAGNETIC 3D TILT
   ------------------------------------------------------------------------------- */

.icon3d--tilt:hover svg {
  transform: rotateX(calc(var(--icon3d-tilt-angle) * -1)) rotateY(var(--icon3d-tilt-angle));
}

.icon3d--tilt:active svg {
  transform: rotateX(calc(var(--icon3d-tilt-angle) * -0.5)) rotateY(calc(var(--icon3d-tilt-angle) * 0.5)) scale(0.96);
}

/* -------------------------------------------------------------------------------
   HOVER EFFECT B: SPECULAR SWEEP (via highlight layer)
   ------------------------------------------------------------------------------- */

.icon3d--specular:hover .icon3d-highlight {
  opacity: calc(var(--icon3d-highlight-opacity) * 1.6);
}

.icon3d--specular:active .icon3d-highlight {
  opacity: calc(var(--icon3d-highlight-opacity) * 0.8);
}

/* -------------------------------------------------------------------------------
   HOVER EFFECT C: DEPTH MORPH
   ------------------------------------------------------------------------------- */

.icon3d--morph:hover .icon3d-shadow {
  opacity: calc(var(--icon3d-shadow-opacity) * 1.4);
  transform: translate(calc(var(--icon3d-shadow-offset-x) * 1.5), calc(var(--icon3d-shadow-offset-y) * 1.5));
}

.icon3d--morph:active .icon3d-shadow {
  opacity: calc(var(--icon3d-shadow-opacity) * 0.7);
  transform: translate(0, 0);
}

/* -------------------------------------------------------------------------------
   HOVER EFFECT D: DIGITAL PULSE (for CTA icons)
   ------------------------------------------------------------------------------- */

.icon3d--pulse:hover svg {
  transform: scale(1.06);
}

.icon3d--pulse:hover .icon3d-highlight {
  opacity: calc(var(--icon3d-highlight-opacity) * 1.4);
}

.icon3d--pulse:active svg {
  transform: scale(0.94);
}

/* -------------------------------------------------------------------------------
   INTERACTIVE VARIANT — Combined effects for nav/action icons
   ------------------------------------------------------------------------------- */

.icon3d--interactive {
  cursor: pointer;
}

.icon3d--interactive:hover svg {
  transform: translateY(-2px) scale(1.04);
}

.icon3d--interactive:hover .icon3d-shadow {
  opacity: calc(var(--icon3d-shadow-opacity) * 1.3);
  transform: translate(calc(var(--icon3d-shadow-offset-x) * 2), calc(var(--icon3d-shadow-offset-y) * 2));
}

.icon3d--interactive:hover .icon3d-highlight {
  opacity: calc(var(--icon3d-highlight-opacity) * 1.5);
}

.icon3d--interactive:active svg {
  transform: translateY(0) scale(0.96);
}

/* -------------------------------------------------------------------------------
   ACCESSIBILITY — REDUCED MOTION
   ------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .icon3d,
  .icon3d svg,
  .icon3d-shadow,
  .icon3d-highlight {
    transition: none;
  }
  
  .icon3d--tilt:hover svg,
  .icon3d--pulse:hover svg,
  .icon3d--interactive:hover svg {
    transform: none;
  }
  
  /* Keep opacity changes as they're not motion */
  .icon3d--specular:hover .icon3d-highlight,
  .icon3d--morph:hover .icon3d-shadow {
    transition: opacity 0ms;
  }
}

/* -------------------------------------------------------------------------------
   UTILITY CLASSES
   ------------------------------------------------------------------------------- */

/* Inline text alignment */
.icon3d--inline {
  vertical-align: -0.125em;
  margin-inline: 0.125em;
}

/* Color inheritance helper */
.icon3d--inherit {
  color: inherit;
}

/* Muted state */
.icon3d--muted {
  opacity: 0.5;
}

.icon3d--muted:hover {
  opacity: 0.7;
}

/* -------------------------------------------------------------------------------
   FLOAT EFFECT — For decorative floating elements
   ------------------------------------------------------------------------------- */

.icon3d--float {
  animation: icon3d-float var(--icon3d-float-duration, 8s) ease-in-out infinite;
  animation-delay: var(--icon3d-float-delay, 0s);
}

@keyframes icon3d-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(2deg);
  }
  50% {
    transform: translateY(-4px) rotate(-1deg);
  }
  75% {
    transform: translateY(-12px) rotate(1deg);
  }
}

/* Replaced icon marker */
.icon3d--replaced {
  display: inline-flex;
}

/* SVG specific styling */
.icon3d-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* -------------------------------------------------------------------------------
   PRINT STYLES
   ------------------------------------------------------------------------------- */

@media print {
  .icon3d-shadow,
  .icon3d-highlight {
    display: none;
  }
  
  .icon3d svg {
    filter: none;
  }
}

