/* ============================================================================
   3D CARD EFFECTS - Modern 3D Interactive Cards
   Based on the provided design with Three.js integration
   Updated to match site theme colors
   ============================================================================ */

/* 3D Perspective Container */
.perspective-container {
  perspective: 1500px;
}

/* 3D Card Base Styles */
.project-card-3d,
.blog-card-3d {
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  height: 450px;
  cursor: pointer;
}

.project-card-3d.reset-transition,
.blog-card-3d.reset-transition {
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* Elements that pop out of the card */
.pop-out-1 { transform: translateZ(30px) !important; }
.pop-out-2 { transform: translateZ(60px) !important; }
.pop-out-3 { transform: translateZ(90px) !important; }

/* Custom Background Patterns for image-less cards */
.bg-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* Card Content Positioning */
.card-3d-content {
  position: absolute;
  inset: 0;
  z-index: 10;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Card Background Layers */
.card-3d-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card-3d-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.project-card-3d:hover .card-3d-bg-image,
.blog-card-3d:hover .card-3d-bg-image {
  opacity: 0.4;
  transform: scale(1.05);
}

.card-3d-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(var(--accent-color-rgb), 0.1) 40%, transparent 100%);
}

/* Three.js Container */
.three-container {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 8rem;
  height: 8rem;
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

/* Card Typography */
.card-3d-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  display: block;
}

.card-3d-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-3d-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tech Tags */
.card-3d-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-3d-tag {
  padding: 0.25rem 0.625rem;
  background: rgba(var(--accent-color-rgb), 0.1);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-color);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(var(--accent-color-rgb), 0.3);
}

/* Meta information styling */
.card-3d-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card-3d-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-3d-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-3d-meta-item i {
  font-size: 0.7rem;
  color: var(--accent-color);
}

/* Featured badge */
.card-3d-featured {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 600;
}

.card-3d-featured svg {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

/* Color Variants for Categories - Using theme colors */
.card-category-blue .card-3d-category { color: var(--accent-color); }
.card-category-purple .card-3d-category { color: #a855f7; }
.card-category-emerald .card-3d-category { color: #10b981; }
.card-category-amber .card-3d-category { color: #f59e0b; }
.card-category-pink .card-3d-category { color: #ec4899; }
.card-category-sky .card-3d-category { color: #0ea5e9; }

/* Responsive Design */
@media (max-width: 768px) {
  .project-card-3d,
  .blog-card-3d {
    height: 400px;
  }
  
  .three-container {
    width: 6rem;
    height: 6rem;
    top: 1rem;
    right: 1rem;
  }
  
  .card-3d-content {
    padding: 1.5rem;
  }
  
  .card-3d-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .project-card-3d,
  .blog-card-3d {
    height: 350px;
  }
  
  .three-container {
    width: 5rem;
    height: 5rem;
  }
  
  .card-3d-content {
    padding: 1.25rem;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .project-card-3d,
  .blog-card-3d {
    transition: none !important;
  }
  
  .project-card-3d:hover .card-3d-bg-image,
  .blog-card-3d:hover .card-3d-bg-image {
    transform: none;
  }
  
  .three-container {
    animation: none !important;
  }
}