/*
  =============================================================================
  Project: 3D Transform Gallery - Styles
  Category: CSS Projects
  Description: Pure CSS 3D transformations, perspective, and animations.
  
  Author Details (Year 2026):
  - Founder: Molla Samser
  - Website: https://rskworld.in
  - Email: help@rskworld.in | support@rskworld.in
  - Phone: +91 93305 39277
  - Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
  - Follow: Facebook, Twitter, Instagram, LinkedIn, GitHub @ rskworld
  =============================================================================
*/

/* Variables loaded via css/variables.css - Molla Samser | rskworld.in | 2026 */

/* ========== Base - Molla Samser | rskworld.in | 2026 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ========== Header - Author: Molla Samser | rskworld.in | 2026 ========== */
.gallery-header {
  text-align: center;
  padding: 2.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
/* Force blue header for page name area - no white background */
.gallery-header.jumbotron-style {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
  background-color: #0d6efd !important;
  border-bottom: none !important;
}
/* No white box inside header - keep container transparent */
.gallery-header.jumbotron-style .container {
  background: transparent !important;
  background-color: transparent !important;
}

/* Navbar top-left: no white box so "3D Gallery" brand is visible on blue */
.navbar.bg-primary .container,
.navbar.bg-primary .container-fluid,
.navbar.bg-primary .navbar-brand {
  background: transparent !important;
  background-color: transparent !important;
}

.gallery-header:not(.jumbotron-style) h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-header.jumbotron-style h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #fff;
  background-clip: unset;
}

.gallery-header:not(.jumbotron-style) p {
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.gallery-header.jumbotron-style p {
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
}

.gallery-header .credit a {
  color: var(--accent-light);
  text-decoration: none;
}

.gallery-header.jumbotron-style .credit a,
.gallery-header.jumbotron-style a {
  color: rgba(255, 255, 255, 0.95);
}

.gallery-header.jumbotron-style .credit a:hover,
.gallery-header.jumbotron-style a:hover {
  color: #fff;
}

.gallery-header .credit a:hover {
  text-decoration: underline;
}

/* ========== Gallery Container - Molla Samser | rskworld.in | 2026 ========== */
.gallery-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.gallery-section {
  scroll-margin-top: 1rem;
}

.gallery-section h2 {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.gallery-section .section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ========== 3D Flip Cards - Pure CSS - rskworld.in | 2026 ========== */
.flip-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.flip-card {
  width: var(--card-width);
  height: var(--card-height);
  perspective: 1000px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s var(--ease-out-back);
  transform-style: preserve-3d;
}

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

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.flip-front {
  background: linear-gradient(145deg, var(--bg-card) 0%, #334155 100%);
  color: var(--accent-light);
}

.flip-back {
  background: linear-gradient(145deg, var(--accent) 0%, #0a58ca 100%);
  color: #fff;
  transform: rotateY(180deg);
}

/* ========== 3D Cube - Perspective & Transforms - rskworld.in | 2026 ========== */
.cube-scene {
  perspective: var(--perspective);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}

.cube {
  position: relative;
  width: var(--cube-size);
  height: var(--cube-size);
  transform-style: preserve-3d;
  animation: cubeRotate 12s linear infinite;
}

.cube:hover {
  animation-play-state: paused;
}

.cube-face {
  position: absolute;
  width: var(--cube-size);
  height: var(--cube-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(145deg, var(--bg-card) 0%, #334155 100%);
  border: 2px solid var(--accent);
  border-radius: 8px;
  backface-visibility: visible;
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.2);
}

.cube-face.front  { transform: translateZ(calc(var(--cube-size) / 2)); }
.cube-face.back   { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.cube-face.right  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.cube-face.top    { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }

@keyframes cubeRotate {
  0%   { transform: rotateX(-18deg) rotateY(0deg); }
  100% { transform: rotateX(-18deg) rotateY(360deg); }
}

/* ========== Perspective Cards (Hover Tilt) - rskworld.in | 2026 ========== */
.perspective-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.perspective-card {
  width: 180px;
  height: 200px;
  perspective: 800px;
  cursor: pointer;
}

.perspective-card .card-content {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s var(--ease-in-out);
  transform-style: preserve-3d;
  background: linear-gradient(145deg, var(--bg-card) 0%, #334155 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.perspective-card:hover .card-content {
  transform: rotateY(10deg) rotateX(10deg) scale(1.05);
  box-shadow: 0 20px 50px rgba(13, 110, 253, 0.25);
}

.perspective-card[data-tilt="2"]:hover .card-content {
  transform: rotateY(-10deg) rotateX(-8deg) scale(1.05);
}

.perspective-card[data-tilt="3"]:hover .card-content {
  transform: rotateY(5deg) rotateX(-12deg) scale(1.05);
}

.card-icon {
  font-size: 2rem;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}

.card-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.card-content p {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ========== 3D Carousel - Visual Effects - rskworld.in | 2026 ========== */
.carousel-scene {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}

.carousel {
  position: relative;
  width: 200px;
  height: 120px;
  transform-style: preserve-3d;
  animation: carouselSpin 15s linear infinite;
}

.carousel-item {
  position: absolute;
  width: 80px;
  height: 100px;
  left: 50%;
  top: 50%;
  margin-left: -40px;
  margin-top: -50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(145deg, var(--accent) 0%, #0a58ca 100%);
  border-radius: 12px;
  border: 2px solid var(--accent-light);
  backface-visibility: visible;
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.4);
}

.carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(140px); }
.carousel-item:nth-child(2) { transform: rotateY(60deg) translateZ(140px); }
.carousel-item:nth-child(3) { transform: rotateY(120deg) translateZ(140px); }
.carousel-item:nth-child(4) { transform: rotateY(180deg) translateZ(140px); }
.carousel-item:nth-child(5) { transform: rotateY(240deg) translateZ(140px); }
.carousel-item:nth-child(6) { transform: rotateY(300deg) translateZ(140px); }

@keyframes carouselSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* ========== Hover 3D Tiles - Interactive Design - rskworld.in | 2026 ========== */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--bg-card) 0%, #334155 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
  transition: transform 0.4s var(--ease-out-back), box-shadow 0.4s;
  transform-style: preserve-3d;
  transform: perspective(500px) rotateX(0deg) rotateY(0deg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tile:hover {
  transform: perspective(500px) rotateX(8deg) rotateY(-8deg) scale(1.08);
  box-shadow: 0 20px 40px rgba(13, 110, 253, 0.3);
}

.tile:nth-child(even):hover {
  transform: perspective(500px) rotateX(-8deg) rotateY(8deg) scale(1.08);
}

/* ========== 3D Book / Card Stack - rskworld.in | 2026 ========== */
.book-stack {
  perspective: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  gap: 0;
}

.book-stack .stack-item {
  width: 70px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--duration-slow) var(--ease-out-back);
  margin-left: -20px;
}

.book-stack .stack-item:first-child { margin-left: 0; }

.book-stack .stack-item:hover {
  transform: rotateY(-35deg) translateZ(20px);
  z-index: 5;
}

.stack-item .face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: 4px;
  backface-visibility: hidden;
}

.stack-item .face.front { transform: translateZ(4px); }
.stack-item .face.right {
  width: 8px;
  left: 100%;
  top: 0;
  transform-origin: left;
  transform: rotateY(90deg);
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

/* ========== 3D Door / Flip Panel - Molla Samser | rskworld.in | 2026 ========== */
.door-scene {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.door-panel {
  width: 120px;
  height: 160px;
  transform-style: preserve-3d;
  cursor: pointer;
}

.door-panel .door-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.9s var(--ease-out-back);
  transform-style: preserve-3d;
  transform-origin: left center;
}

.door-panel:hover .door-inner {
  transform: rotateY(-110deg);
}

.door-front,
.door-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid var(--border);
}

.door-front {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  color: var(--accent-light);
}

.door-back {
  background: linear-gradient(145deg, var(--accent) 0%, #0a58ca 100%);
  color: #fff;
  transform: rotateY(180deg);
}

/* ========== Floating 3D Cards - rskworld.in | 2026 ========== */
.floating-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  perspective: 1000px;
}

.floating-card {
  width: 130px;
  height: 160px;
  transform-style: preserve-3d;
  animation: float 4s var(--ease-in-out) infinite;
}

.floating-card:nth-child(2) { animation-delay: 0.5s; }
.floating-card:nth-child(3) { animation-delay: 1s; }

.floating-card .float-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-light);
  transition: transform var(--duration-normal);
  transform: rotateX(5deg) rotateY(5deg);
  box-shadow: 0 10px 30px var(--shadow);
}

.floating-card:hover .float-inner {
  transform: rotateX(0) rotateY(0) scale(1.08);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ========== 3D Text - Molla Samser | rskworld.in | 2026 ========== */
.text-3d-scene {
  perspective: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
}

.text-3d {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--accent-light);
  transform: rotateX(12deg) rotateY(-8deg);
  transition: transform 0.4s var(--ease-in-out);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.2), 0 8px 20px var(--shadow-accent);
}

.text-3d-scene:hover .text-3d {
  transform: rotateX(0deg) rotateY(0deg) scale(1.05);
}

/* ========== 3D Photo Frames - rskworld.in | 2026 ========== */
.frames-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  perspective: 1000px;
}

.frame-3d {
  width: 120px;
  height: 140px;
  perspective: 400px;
  cursor: pointer;
}

.frame-inner {
  width: 100%;
  height: 100%;
  border: 6px solid var(--bg-elevated);
  background: var(--bg-card);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-out-back);
  transform-style: preserve-3d;
  transform: rotateY(0deg) rotateX(0deg);
  box-shadow: 0 10px 30px var(--shadow);
}

.frame-3d:hover .frame-inner {
  transform: rotateY(-15deg) rotateX(8deg);
  box-shadow: 0 20px 40px var(--shadow-accent);
}

.frame-placeholder {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
}

/* ========== 3D Accordion Stack - Molla Samser | rskworld.in | 2026 ========== */
.accordion-stack {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  perspective: 800px;
  min-height: 160px;
}

.accordion-card {
  width: 90px;
  height: 120px;
  margin-left: -25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-light);
  transform-origin: center right;
  transition: transform 0.5s var(--ease-out-back);
  cursor: pointer;
}

.accordion-card:first-child { margin-left: 0; }

.accordion-stack:hover .accordion-card {
  transform: rotateY(25deg);
}

.accordion-stack .accordion-card:hover {
  transform: rotateY(0deg) translateZ(20px);
  z-index: 5;
}

/* ========== 3D Ribbon / Banner - rskworld.in | 2026 ========== */
.ribbon-3d-scene {
  perspective: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.ribbon-3d {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--accent) 0%, #0a58ca 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 4px;
  transform: rotateX(25deg) rotateZ(-2deg);
  transition: transform 0.4s var(--ease-in-out);
  box-shadow: 0 8px 24px var(--shadow-accent);
}

.ribbon-3d-scene:hover .ribbon-3d {
  transform: rotateX(10deg) rotateZ(0deg) scale(1.05);
}

/* ========== Footer - Molla Samser | rskworld.in | 2026 ========== */
.gallery-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: #64748b;
  font-size: 0.9rem;
}

.gallery-footer a {
  color: var(--accent-light);
  text-decoration: none;
}

.gallery-footer a:hover {
  text-decoration: underline;
}

.gallery-footer p + p {
  margin-top: 0.5rem;
}
