/**
 * IBTechEdu - Futuristic AI Visual Effects
 * Inspired by modern AI/tech websites
 *
 * @package IBTechEdu
 * @version 1.0.0
 */

/* ========================================
   ENHANCED CSS VARIABLES
======================================== */
:root {
    /* Extended Color Palette */
    --navy-deep: #020617;
    --navy-dark: #0a0f1c;
    --navy-medium: #0f172a;
    --navy-light: #1e293b;

    /* Neon/Glow Colors */
    --neon-blue: #3b82f6;
    --neon-purple: #8b5cf6;
    --neon-cyan: #22d3ee;
    --neon-pink: #ec4899;
    --neon-green: #10b981;

    /* Glow Effects */
    --glow-blue-soft: rgba(59, 130, 246, 0.15);
    --glow-blue-medium: rgba(59, 130, 246, 0.3);
    --glow-blue-strong: rgba(59, 130, 246, 0.5);
    --glow-purple-soft: rgba(139, 92, 246, 0.15);
    --glow-purple-medium: rgba(139, 92, 246, 0.3);
    --glow-cyan-soft: rgba(34, 211, 238, 0.15);
    --glow-cyan-medium: rgba(34, 211, 238, 0.3);

    /* Gradients */
    --gradient-aurora: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #22d3ee 75%, #3b82f6 100%);
    --gradient-mesh: linear-gradient(45deg, var(--navy-deep) 0%, var(--navy-dark) 50%, var(--navy-medium) 100%);
    --gradient-radial-blue: radial-gradient(ellipse at center, var(--glow-blue-medium), transparent 70%);
    --gradient-radial-purple: radial-gradient(ellipse at center, var(--glow-purple-medium), transparent 70%);
}

/* ========================================
   ANIMATED GRADIENT ORB BACKGROUNDS
======================================== */
.orb-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--glow-blue-medium);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--glow-purple-medium);
    top: 30%;
    right: -15%;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--glow-cyan-medium);
    bottom: -10%;
    left: 30%;
    animation-delay: -10s;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--glow-blue-medium), var(--glow-purple-medium));
    top: 50%;
    left: 10%;
    animation-delay: -15s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 50px) scale(0.9);
    }
    75% {
        transform: translate(-50px, -20px) scale(1.05);
    }
}

/* ========================================
   NEURAL NETWORK ANIMATION
======================================== */
.neural-network {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.neural-network svg {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.neural-node {
    fill: var(--neon-blue);
    animation: nodeGlow 3s ease-in-out infinite;
}

.neural-node:nth-child(odd) {
    animation-delay: -1.5s;
}

.neural-line {
    stroke: var(--neon-cyan);
    stroke-width: 1;
    opacity: 0.3;
    animation: lineFlow 4s linear infinite;
}

@keyframes nodeGlow {
    0%, 100% {
        opacity: 0.5;
        r: 3;
    }
    50% {
        opacity: 1;
        r: 5;
    }
}

@keyframes lineFlow {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ========================================
   GLASSMORPHISM CARDS
======================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.glass-card-dark {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

/* ========================================
   ENHANCED HERO SECTION
======================================== */
.hero-section {
    background: var(--navy-deep);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 100% at 50% -50%, var(--glow-blue-soft), transparent),
        radial-gradient(ellipse 80% 60% at 100% 50%, var(--glow-purple-soft), transparent),
        radial-gradient(ellipse 60% 80% at 0% 100%, var(--glow-cyan-soft), transparent);
}

/* Animated mesh gradient */
.hero-mesh {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
    animation: meshPulse 8s ease-in-out infinite;
}

@keyframes meshPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Floating AI visualization */
.ai-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    opacity: 0.8;
}

.ai-visual-inner {
    position: relative;
    width: 100%;
    height: 100%;
    animation: aiRotate 30s linear infinite;
}

@keyframes aiRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-ring {
    position: absolute;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: ringPulse 4s ease-in-out infinite;
}

.ai-ring:nth-child(1) {
    inset: 0;
    animation-delay: 0s;
}

.ai-ring:nth-child(2) {
    inset: 50px;
    animation-delay: -1s;
    border-color: rgba(139, 92, 246, 0.3);
}

.ai-ring:nth-child(3) {
    inset: 100px;
    animation-delay: -2s;
    border-color: rgba(34, 211, 238, 0.3);
}

.ai-ring:nth-child(4) {
    inset: 150px;
    animation-delay: -3s;
    border-color: rgba(59, 130, 246, 0.3);
}

@keyframes ringPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Central AI core */
.ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px var(--glow-blue-medium),
        0 0 60px var(--glow-blue-soft),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% {
        box-shadow:
            0 0 30px var(--glow-blue-medium),
            0 0 60px var(--glow-blue-soft);
    }
    50% {
        box-shadow:
            0 0 50px var(--glow-blue-strong),
            0 0 100px var(--glow-blue-medium);
    }
}

/* ========================================
   DATA FLOW LINES
======================================== */
.data-flow {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.flow-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: flowMove 8s linear infinite;
}

.flow-line:nth-child(1) {
    top: 20%;
    width: 300px;
    left: -300px;
    animation-delay: 0s;
}

.flow-line:nth-child(2) {
    top: 40%;
    width: 200px;
    left: -200px;
    animation-delay: -2s;
}

.flow-line:nth-child(3) {
    top: 60%;
    width: 400px;
    left: -400px;
    animation-delay: -4s;
}

.flow-line:nth-child(4) {
    top: 80%;
    width: 250px;
    left: -250px;
    animation-delay: -6s;
}

@keyframes flowMove {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 400px));
        opacity: 0;
    }
}

/* ========================================
   ENHANCED FEATURE CARDS
======================================== */
.feature-card.futuristic {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.feature-card.futuristic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(59, 130, 246, 0.1) 60deg,
        transparent 120deg
    );
    animation: cardScan 8s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.feature-card.futuristic:hover::before {
    opacity: 1;
}

@keyframes cardScan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.feature-card.futuristic .feature-icon {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.2),
        rgba(139, 92, 246, 0.2)
    );
    border: 1px solid rgba(59, 130, 246, 0.3);
    position: relative;
}

.feature-card.futuristic .feature-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: var(--primary-gradient);
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: opacity var(--transition-base);
}

.feature-card.futuristic:hover .feature-icon::after {
    opacity: 0.5;
}

/* ========================================
   GLOWING BORDERS
======================================== */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--primary-gradient);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(10px);
    transition: opacity var(--transition-base);
}

.glow-border:hover::before {
    opacity: 0.5;
}

/* Animated border gradient */
.animated-border {
    position: relative;
    background: var(--navy-medium);
    border-radius: var(--radius-xl);
}

.animated-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        90deg,
        var(--neon-blue),
        var(--neon-purple),
        var(--neon-cyan),
        var(--neon-blue)
    );
    background-size: 300% 100%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderFlow 4s linear infinite;
}

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

/* ========================================
   MARQUEE / LOGO CAROUSEL
======================================== */
.logo-marquee {
    position: relative;
    overflow: hidden;
    padding: var(--spacing-2xl) 0;
    background: var(--navy-dark);
}

.logo-marquee::before,
.logo-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 10;
    pointer-events: none;
}

.logo-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--navy-dark), transparent);
}

.logo-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--navy-dark), transparent);
}

.marquee-track {
    display: flex;
    gap: var(--spacing-3xl);
    animation: marquee 30s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

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

.marquee-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 60px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all var(--transition-base);
}

.marquee-item:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* ========================================
   TYPING EFFECT TEXT
======================================== */
.typing-text {
    display: inline-block;
    border-right: 2px solid var(--neon-cyan);
    animation: blink 1s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ========================================
   HOLOGRAPHIC EFFECT
======================================== */
.holographic {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(139, 92, 246, 0.1) 25%,
        rgba(236, 72, 153, 0.1) 50%,
        rgba(34, 211, 238, 0.1) 75%,
        rgba(59, 130, 246, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: holographicShift 10s ease infinite;
}

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

/* ========================================
   TECH DOTS PATTERN
======================================== */
.tech-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(59, 130, 246, 0.3) 1px,
        transparent 1px
    );
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black, transparent);
    pointer-events: none;
}

/* ========================================
   CIRCUIT BOARD PATTERN
======================================== */
.circuit-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.8) 2px, transparent 2px);
    background-size: 40px 40px, 40px 40px, 40px 40px;
    pointer-events: none;
}

/* ========================================
   FUTURISTIC BUTTONS
======================================== */
.btn-futuristic {
    position: relative;
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: var(--white);
    overflow: hidden;
    z-index: 1;
}

.btn-futuristic::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.btn-futuristic::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-futuristic:hover::before {
    opacity: 1;
}

.btn-futuristic:hover::after {
    width: 300px;
    height: 300px;
}

.btn-futuristic:hover {
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 0 30px var(--glow-blue-medium);
}

/* ========================================
   SCAN LINE EFFECT
======================================== */
.scan-effect {
    position: relative;
    overflow: hidden;
}

.scan-effect::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(59, 130, 246, 0.1),
        transparent
    );
    animation: scanMove 3s linear infinite;
    pointer-events: none;
}

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

/* ========================================
   STATS WITH GLOW
======================================== */
.stat-glow .stat-number {
    text-shadow: 0 0 20px var(--glow-blue-medium);
}

.stat-glow .stat-number::before {
    content: attr(data-value);
    position: absolute;
    top: 0;
    left: 0;
    filter: blur(10px);
    opacity: 0.5;
}

/* ========================================
   DARK THEME SECTIONS
======================================== */
.section-dark {
    background: var(--navy-deep);
    color: var(--white);
    position: relative;
}

.section-dark .section-title {
    color: var(--white);
}

.section-dark .section-desc {
    color: var(--gray-400);
}

.section-dark .feature-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.section-dark .feature-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.section-dark .feature-title {
    color: var(--white);
}

.section-dark .feature-desc {
    color: var(--gray-400);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 1024px) {
    .ai-visual {
        width: 300px;
        height: 300px;
        right: -50px;
        opacity: 0.4;
    }

    .orb {
        filter: blur(60px);
    }

    .orb-1 { width: 400px; height: 400px; }
    .orb-2 { width: 350px; height: 350px; }
    .orb-3 { width: 300px; height: 300px; }
}

@media (max-width: 768px) {
    .ai-visual {
        display: none;
    }

    .data-flow {
        display: none;
    }

    .orb {
        filter: blur(40px);
    }
}

/* ========================================
   PREFERS REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
    .orb,
    .ai-ring,
    .ai-core,
    .flow-line,
    .marquee-track,
    .hero-mesh,
    .neural-node,
    .neural-line,
    .animated-border::before,
    .holographic,
    .scan-effect::after,
    .feature-card.futuristic::before {
        animation: none;
    }

    .typing-text {
        border-right: none;
    }
}
