/* ===================================================================
   COMUNIDADE CATÓLICA YESHUÁ - 3D COMPONENTS STYLESHEET
   Advanced 3D effects and WebGL-inspired styles
   =================================================================== */

/* ==================== 3D CARD EFFECTS ==================== */

/* Base 3D Card */
.card-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    cursor: pointer;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg)) translateZ(20px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 40px rgba(59, 130, 246, 0.2);
}

/* 3D Card Inner */
.card-3d-inner {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

/* 3D Card Depth Layers */
.card-3d .card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translateZ(-10px);
    opacity: 0.5;
}

.card-3d .card-reflection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-3d:hover .card-reflection {
    opacity: 1;
}

/* ==================== TILT EFFECT ==================== */

.tilt-effect {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-effect-inner {
    transition: transform 0.3s ease-out;
}

.tilt-effect:hover .tilt-effect-inner {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* Tilt Glow */
.tilt-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at var(--glow-x, 50%) var(--glow-y, 50%),
        rgba(255, 255, 255, 0.3) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.tilt-effect:hover .tilt-glow {
    opacity: 1;
}

/* ==================== 3D CROSS ELEMENT ==================== */

.cross-3d-container {
    perspective: 1000px;
    width: 100px;
    height: 200px;
    position: relative;
}

.cross-3d-element {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: cross-rotate-3d 10s linear infinite;
}

@keyframes cross-rotate-3d {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(10deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg);
    }
}

.cross-3d-element .face {
    position: absolute;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}

/* Vertical Part */
.cross-3d-element .cross-vertical-front {
    width: 30px;
    height: 150px;
    left: 35px;
    top: 25px;
    transform: translateZ(15px);
}

.cross-3d-element .cross-vertical-back {
    width: 30px;
    height: 150px;
    left: 35px;
    top: 25px;
    transform: translateZ(-15px) rotateY(180deg);
}

.cross-3d-element .cross-vertical-left {
    width: 30px;
    height: 150px;
    left: 20px;
    top: 25px;
    transform: rotateY(-90deg) translateZ(15px);
}

.cross-3d-element .cross-vertical-right {
    width: 30px;
    height: 150px;
    left: 50px;
    top: 25px;
    transform: rotateY(90deg) translateZ(15px);
}

/* Horizontal Part */
.cross-3d-element .cross-horizontal-front {
    width: 80px;
    height: 30px;
    left: 10px;
    top: 50px;
    transform: translateZ(15px);
}

.cross-3d-element .cross-horizontal-back {
    width: 80px;
    height: 30px;
    left: 10px;
    top: 50px;
    transform: translateZ(-15px) rotateY(180deg);
}

/* ==================== 3D BUTTONS ==================== */

.btn-3d-push {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.15s ease;
}

.btn-3d-push::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
    border-radius: inherit;
    transform: translateZ(-5px) translateY(5px);
    transition: transform 0.15s ease;
}

.btn-3d-push:hover {
    transform: translateZ(5px);
}

.btn-3d-push:active {
    transform: translateZ(0) translateY(3px);
}

.btn-3d-push:active::before {
    transform: translateZ(-3px) translateY(2px);
}

/* Floating Button */
.btn-floating-3d {
    position: relative;
    animation: float-button 3s ease-in-out infinite;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

@keyframes float-button {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
}

/* ==================== 3D TEXT ==================== */

.text-3d {
    text-shadow:
        1px 1px 0 rgba(0, 0, 0, 0.1),
        2px 2px 0 rgba(0, 0, 0, 0.1),
        3px 3px 0 rgba(0, 0, 0, 0.1),
        4px 4px 0 rgba(0, 0, 0, 0.1),
        5px 5px 0 rgba(0, 0, 0, 0.1),
        6px 6px 20px rgba(0, 0, 0, 0.2);
}

.text-3d-gold {
    color: #f59e0b;
    text-shadow:
        1px 1px 0 #d97706,
        2px 2px 0 #b45309,
        3px 3px 0 #92400e,
        4px 4px 0 #78350f,
        5px 5px 15px rgba(0, 0, 0, 0.3);
}

/* Embossed Text */
.text-embossed {
    color: transparent;
    background: linear-gradient(180deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.3),
        -1px -1px 0 rgba(255, 255, 255, 0.5);
}

/* ==================== PARALLAX 3D ==================== */

.parallax-3d {
    perspective: 1000px;
    overflow: hidden;
}

.parallax-3d-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.parallax-3d-layer.layer-1 {
    transform: translateZ(-100px) scale(1.1);
}

.parallax-3d-layer.layer-2 {
    transform: translateZ(-50px) scale(1.05);
}

.parallax-3d-layer.layer-3 {
    transform: translateZ(0);
}

.parallax-3d-layer.layer-4 {
    transform: translateZ(50px) scale(0.95);
}

/* ==================== 3D RINGS ==================== */

.rings-3d {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    animation: rings-rotate 15s linear infinite;
}

@keyframes rings-rotate {
    from { transform: rotateX(60deg) rotateZ(0deg); }
    to { transform: rotateX(60deg) rotateZ(360deg); }
}

.ring-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid var(--primary-light);
    border-radius: 50%;
    animation: ring-pulse 2s ease-in-out infinite;
}

.ring-3d:nth-child(1) {
    width: 100px;
    height: 100px;
    animation-delay: 0s;
}

.ring-3d:nth-child(2) {
    width: 150px;
    height: 150px;
    animation-delay: 0.3s;
}

.ring-3d:nth-child(3) {
    width: 200px;
    height: 200px;
    animation-delay: 0.6s;
}

.ring-3d:nth-child(4) {
    width: 250px;
    height: 250px;
    animation-delay: 0.9s;
}

@keyframes ring-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ==================== GLASS MORPHISM ==================== */

.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glass-panel-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ==================== NEON EFFECTS ==================== */

.neon-glow {
    text-shadow:
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
}

.neon-glow-blue {
    color: #38bdf8;
    text-shadow:
        0 0 5px #38bdf8,
        0 0 10px #38bdf8,
        0 0 20px #38bdf8,
        0 0 40px #0ea5e9;
}

.neon-glow-gold {
    color: #f59e0b;
    text-shadow:
        0 0 5px #f59e0b,
        0 0 10px #f59e0b,
        0 0 20px #f59e0b,
        0 0 40px #d97706;
}

.neon-border {
    box-shadow:
        0 0 5px var(--primary-light),
        0 0 10px var(--primary-light),
        inset 0 0 5px var(--primary-light);
}

/* ==================== HOLOGRAPHIC EFFECT ==================== */

.holographic {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 200%;
    animation: holographic-shift 3s ease infinite;
}

@keyframes holographic-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.holographic-card {
    position: relative;
    overflow: hidden;
}

.holographic-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    animation: holographic-shine 2s linear infinite;
    pointer-events: none;
}

@keyframes holographic-shine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== DEPTH SHADOWS ==================== */

.shadow-depth-1 {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-depth-2 {
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.16),
        0 3px 6px rgba(0, 0, 0, 0.23);
}

.shadow-depth-3 {
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.19),
        0 6px 6px rgba(0, 0, 0, 0.23);
}

.shadow-depth-4 {
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.22);
}

.shadow-depth-5 {
    box-shadow:
        0 19px 38px rgba(0, 0, 0, 0.30),
        0 15px 12px rgba(0, 0, 0, 0.22);
}

/* ==================== FLOATING ELEMENTS ==================== */

.float-3d {
    animation: float-3d 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes float-3d {
    0%, 100% {
        transform: translateY(0) rotateX(0) rotateY(0);
    }
    25% {
        transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: translateY(0) rotateX(0) rotateY(10deg);
    }
    75% {
        transform: translateY(-5px) rotateX(-5deg) rotateY(5deg);
    }
}

/* Orbit Animation */
.orbit-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-item {
    position: absolute;
    animation: orbit 10s linear infinite;
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(120px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(120px) rotate(-360deg);
    }
}

.orbit-item:nth-child(1) { animation-delay: 0s; }
.orbit-item:nth-child(2) { animation-delay: -2.5s; }
.orbit-item:nth-child(3) { animation-delay: -5s; }
.orbit-item:nth-child(4) { animation-delay: -7.5s; }

/* ==================== PARTICLE FIELD ==================== */

.particle-field {
    position: relative;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0;
    animation: particle-rise 4s linear infinite;
}

@keyframes particle-rise {
    0% {
        opacity: 0;
        transform: translateY(100%) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* ==================== WAVE EFFECT ==================== */

.wave-container {
    position: relative;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23ffffff' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-size: 50% 100%;
    animation: wave-flow 10s linear infinite;
}

@keyframes wave-flow {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.wave:nth-child(2) {
    bottom: 10px;
    opacity: 0.5;
    animation-duration: 15s;
    animation-direction: reverse;
}

.wave:nth-child(3) {
    bottom: 20px;
    opacity: 0.3;
    animation-duration: 20s;
}

/* ==================== CUBE 3D ==================== */

.cube-3d {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    animation: cube-spin 10s linear infinite;
}

@keyframes cube-spin {
    from { transform: rotateX(0) rotateY(0); }
    to { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-3d .face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(59, 130, 246, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.cube-3d .front  { transform: rotateY(0deg) translateZ(50px); }
.cube-3d .back   { transform: rotateY(180deg) translateZ(50px); }
.cube-3d .right  { transform: rotateY(90deg) translateZ(50px); }
.cube-3d .left   { transform: rotateY(-90deg) translateZ(50px); }
.cube-3d .top    { transform: rotateX(90deg) translateZ(50px); }
.cube-3d .bottom { transform: rotateX(-90deg) translateZ(50px); }

/* ==================== SPOTLIGHT EFFECT ==================== */

.spotlight-container {
    position: relative;
    overflow: hidden;
}

.spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 200px at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.2) 0%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotlight-container:hover .spotlight {
    opacity: 1;
}

/* ==================== GRADIENT MESH ==================== */

.gradient-mesh {
    background: 
        radial-gradient(at 40% 20%, #1e3a8a 0px, transparent 50%),
        radial-gradient(at 80% 0%, #38bdf8 0px, transparent 50%),
        radial-gradient(at 0% 50%, #60a5fa 0px, transparent 50%),
        radial-gradient(at 80% 50%, #f59e0b 0px, transparent 50%),
        radial-gradient(at 0% 100%, #3b82f6 0px, transparent 50%),
        radial-gradient(at 80% 100%, #1e40af 0px, transparent 50%);
    background-size: 200% 200%;
    animation: gradient-mesh-move 15s ease infinite;
}

@keyframes gradient-mesh-move {
    0%, 100% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

/* ==================== RESPONSIVE 3D ==================== */

@media (max-width: 767px) {
    .card-3d:hover {
        transform: none;
    }
    
    .tilt-effect:hover .tilt-effect-inner {
        transform: none;
    }
    
    .cube-3d,
    .rings-3d,
    .cross-3d-element {
        animation-duration: 20s;
    }
    
    .float-3d {
        animation: none;
    }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .card-3d:hover,
    .tilt-effect:hover .tilt-effect-inner {
        transform: none;
    }
    
    .cube-3d,
    .rings-3d,
    .cross-3d-element,
    .float-3d,
    .orbit-item,
    .wave,
    .particle,
    .holographic-card::before {
        animation: none;
    }
    
    .btn-floating-3d {
        animation: none;
    }
}
