/* ===== 3D Medical Theme Styles ===== */

/* Floating 3D particles overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(600px circle at 20% 40%, rgba(220, 38, 38, 0.04), transparent 50%),
        radial-gradient(800px circle at 80% 60%, rgba(153, 27, 27, 0.04), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 3D Card tilt effect */
.subject-card .card-3d-wrapper {
    will-change: transform;
}

/* Glassmorphism effects */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* 3D floating animation for hero visual */
.hero-3d {
    position: relative;
}

.dna-helix {
    width: 300px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    animation: dnaRotate 20s linear infinite;
}

@keyframes dnaRotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* 3D Grid lines on background */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* Neon glow borders */
.neon-border {
    position: relative;
}

.neon-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

.neon-border:hover::after { opacity: 1; }

/* 3D Depth shadows */
.depth-shadow {
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        0 8px 16px rgba(0,0,0,0.2),
        0 16px 32px rgba(0,0,0,0.1);
}

/* Pulse animation for CTA */
.btn-glow {
    position: relative;
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    opacity: 0;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* 3D Card hover parallax */
.subject-card:hover .card-icon {
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotateZ(0deg); }
    50% { transform: translateY(-8px) rotateZ(3deg); }
}

/* Holographic gradient effect */
.holo-gradient {
    background: linear-gradient(
        135deg,
        rgba(220, 38, 38, 0.06) 0%,
        rgba(153, 27, 27, 0.06) 25%,
        rgba(220, 38, 38, 0.04) 50%,
        rgba(239, 68, 68, 0.06) 75%,
        rgba(220, 38, 38, 0.06) 100%
    );
    background-size: 400% 400%;
    animation: holoShift 8s ease infinite;
}

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

/* Medical cross pulse */
.medical-pulse {
    position: fixed;
    top: 20%;
    right: 10%;
    width: 40px;
    height: 40px;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}

.medical-pulse::before,
.medical-pulse::after {
    content: '';
    position: absolute;
    background: var(--accent-red, #DC2626);
    border-radius: 2px;
}

.medical-pulse::before {
    width: 100%;
    height: 30%;
    top: 35%;
}

.medical-pulse::after {
    width: 30%;
    height: 100%;
    left: 35%;
}

/* Floating molecules */
.float-element {
    position: absolute;
    opacity: 0.04;
    pointer-events: none;
    animation: floatAround 15s ease-in-out infinite;
}

@keyframes floatAround {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(90deg); }
    50% { transform: translate(-10px, -50px) rotate(180deg); }
    75% { transform: translate(-30px, -20px) rotate(270deg); }
}

/* Scan line effect */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.2), transparent);
    z-index: 9999;
    animation: scanMove 4s linear infinite;
    pointer-events: none;
    opacity: 0.3;
}

@keyframes scanMove {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* 3D perspective for section entries */
.section-header {
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.6s ease;
}

/* Dot matrix pattern */
.dot-pattern {
    background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Animated gradient border for featured items */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.animated-border {
    --angle: 0deg;
    border: 2px solid;
    border-image: conic-gradient(from var(--angle), var(--accent-cyan), var(--accent-purple), var(--accent-pink), var(--accent-cyan)) 1;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    to { --angle: 360deg; }
}

/* 3D Text shadow */
.text-3d {
    text-shadow:
        0 1px 0 rgba(220, 38, 38, 0.08),
        0 2px 0 rgba(220, 38, 38, 0.06),
        0 3px 0 rgba(220, 38, 38, 0.04),
        0 4px 0 rgba(220, 38, 38, 0.02);
}

/* Heartbeat line */
.heartbeat-line {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.heartbeat-line::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 100%;
    background: var(--gradient-primary);
    animation: heartbeatMove 3s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes heartbeatMove {
    0% { left: -200px; }
    100% { left: 100%; }
}
