/*
==============================================
PLEY — CARDS CSS
Contiene: plan-card, device-card, virtue-card,
feature-card, flip-card, glass-morphism.
==============================================
*/

/* ============================================
   FEATURE ICON / CARD
   ============================================ */
.feature-icon {
  color: #dd00ff;
}

.feature-card {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.feature-card:hover {
  border-color: rgba(221, 0, 255, 0.5) !important;
  transform: translateY(-8px) !important;
  box-shadow: 0 15px 30px -10px rgba(221, 0, 255, 0.3) !important;
}

/* ============================================
   DEVICE CARD
   ============================================ */
.device-card {
  background-color: rgba(44, 31, 63, 0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  overflow: visible;
  position: relative;
  min-height: 220px;
}

.device-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  width: 100%;
}

.device-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 auto;
  width: 100%;
}

.device-card:hover {
  transform: translateY(-10px) rotateY(15deg) rotateX(10deg);
  border-color: #dd00ff;
  box-shadow: 0 20px 40px rgba(221, 0, 255, 0.3);
}

/* Ícono del device */
.device-icon-container {
  animation: tilt3D 3s ease-in-out infinite;
  transform-style: preserve-3d;
  perspective: 1000px;
  transform-origin: center center;
  overflow: visible;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
}

.device-icon {
  transform-style: preserve-3d;
  backface-visibility: visible;
  font-size: 2rem;
  color: white;
}

/* Delays para cada device card */
.device-card:nth-child(1) .device-icon-container { animation-delay: 0s; }
.device-card:nth-child(2) .device-icon-container { animation-delay: 0.5s; }
.device-card:nth-child(3) .device-icon-container { animation-delay: 1s; }
.device-card:nth-child(4) .device-icon-container { animation-delay: 1.5s; }

/* ============================================
   VIRTUE CARD
   ============================================ */
.virtue-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.virtue-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(221, 0, 255, 0.1) 0%, rgba(94, 0, 179, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 1rem;
}

.virtue-card:hover::before {
  opacity: 1;
}

.virtue-card:hover {
  transform: translateY(-15px) rotateX(10deg) rotateY(5deg) scale(1.02);
  border-color: rgba(221, 0, 255, 0.5);
  box-shadow: 0 25px 50px rgba(221, 0, 255, 0.4);
}

.virtue-icon-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  perspective: 1000px;
}

.virtue-icon {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
  transition: all 0.5s ease;
  transform-style: preserve-3d;
  animation: virtue-icon-float 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.virtue-card:hover .virtue-icon {
  transform: rotateY(360deg) scale(1.1);
  box-shadow: 0 20px 40px rgba(221, 0, 255, 0.6);
}

.virtue-floating-elements {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.floating-circle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: linear-gradient(45deg, #dd00ff, #aa00ff);
  border-radius: 50%;
  opacity: 0.7;
  animation: virtue-floating 4s ease-in-out infinite;
}

.floating-circle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.floating-circle:nth-child(2) { top: 60%; right: 15%; animation-delay: 1.5s; }
.floating-circle:nth-child(3) { bottom: 25%; left: 60%; animation-delay: 3s; }
.floating-circle.delay-1 { animation-delay: 1s !important; }
.floating-circle.delay-2 { animation-delay: 2s !important; }

.virtue-features {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(221, 0, 255, 0.1);
  border-radius: 0.5rem;
  border: 1px solid rgba(221, 0, 255, 0.2);
  flex: 1;
  justify-content: center;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(221, 0, 255, 0.2);
  transform: translateY(-2px);
}

.touch-effect {
  animation: touch-pulse 0.5s ease-in-out;
}

/* Esferas y elementos 3D */
.virtue-3d-elements {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-sphere {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(221, 0, 255, 0.3), rgba(94, 0, 179, 0.1));
  animation: sphere-float 8s ease-in-out infinite;
  filter: blur(1px);
}

.sphere-1 { width: 60px; height: 60px; top: 10%; left: 10%; animation-delay: 0s; }
.sphere-2 { width: 40px; height: 40px; top: 70%; right: 15%; animation-delay: 2s; }
.sphere-3 { width: 80px; height: 80px; bottom: 20%; left: 70%; animation-delay: 4s; }

/* ============================================
   FLIP CARD
   ============================================ */
.flip-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.flip-card-inner {
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 0.75rem;
}

.flip-card-front {
  background: linear-gradient(to bottom right, #dd00ff, #aa00ff);
}

.flip-card-back {
  background: linear-gradient(to bottom right, #aa00ff, #7700cc);
  transform: rotateY(180deg);
}

/* ============================================
   HOVER 3D
   ============================================ */
.perspective-1000 {
  perspective: 1000px;
}

.hover-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.hover-3d:hover {
  transform: translateZ(20px);
}

.hover-3d-element {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.hover-3d:hover .hover-3d-element {
  transform: translateZ(30px);
}

/* ============================================
   CIRCLE 3D
   ============================================ */
.circle-3d {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(45deg, #dd00ff, transparent);
  box-shadow: 0 0 20px rgba(221, 0, 255, 0.7);
  transform-style: preserve-3d;
  animation: circle3d 8s ease-in-out infinite;
}

/* Material icon override */
span.material-icons.text-white.text-6xl {
  font-size: 50px !important;
}

/* ============================================
   RESPONSIVE — DEVICE CARD
   ============================================ */
@media (max-width: 1024px) {
  .device-card { min-height: 200px; }
  .device-card h3 { font-size: 1.125rem; }
  .device-card p { font-size: 0.85rem; }
}

@media (max-width: 768px) {
  .device-card { min-height: 180px; padding: 1.25rem; }
  .device-card h3 { font-size: 1rem; margin-bottom: 0.375rem; }
  .device-card p { font-size: 0.8rem; line-height: 1.3; }

  .virtue-icon { width: 60px !important; height: 60px !important; }
  .virtue-icon .material-icons { font-size: 2.5rem !important; }
  .virtue-icon-container { height: 100px; }
  .virtue-card { margin-bottom: 1.5rem; padding: 1.25rem; }
  .virtue-features { flex-direction: column; gap: 0.5rem; }
  .feature-item { justify-content: flex-start; padding: 0.375rem; font-size: 0.75rem; }
  .feature-item .material-icons { font-size: 1rem !important; }
  .feature-item .text-xs { font-size: 0.675rem; }
  .virtue-card h3 { font-size: 1.125rem; margin-bottom: 0.75rem; }
  .virtue-card p { font-size: 0.8rem; line-height: 1.4; }

  @keyframes tilt3D {
    0%, 100% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(12deg) rotateX(4deg); }
    50% { transform: rotateY(0deg) rotateX(8deg); }
    75% { transform: rotateY(-12deg) rotateX(4deg); }
  }
}

@media (max-width: 480px) {
  .device-card { min-height: 160px; padding: 1rem; }
  .device-card h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
  .device-card p { font-size: 0.75rem; line-height: 1.2; }
  .device-icon-container { width: 3rem !important; height: 3rem !important; margin-bottom: 0.75rem !important; }
  .device-icon { font-size: 1.5rem !important; }
  .virtue-card { padding: 1rem; }
  .virtue-features { gap: 0.375rem; }
  .feature-item { padding: 0.25rem; min-height: 2rem; }
}

@media (max-width: 320px) {
  .device-card { min-height: 140px; padding: 0.75rem; }
  .device-card h3 { font-size: 0.85rem; }
  .device-card p { font-size: 0.7rem; }
}
