/**
 * KodeMinds 3D Animated Background Styles
 * Ensures proper layering and readability
 */

/* Background Canvas Container */
#bg-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Canvas Element */
#bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Ensure content is above background */
body {
    position: relative;
    z-index: 1;
}

/* Section styling for background transitions */
section[data-bg-section] {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text readability enhancements */
.content-overlay {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin: 1rem;
}

/* Hero section specific styles */
section[data-bg-section="hero"] {
    background: transparent;
}

section[data-bg-section="hero"] .hero-content {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* About section */
section[data-bg-section="about"] {
    background: transparent;
}

/* Services section */
section[data-bg-section="services"] {
    background: transparent;
}

/* Contact section */
section[data-bg-section="contact"] {
    background: transparent;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.bg-loading {
    background: linear-gradient(135deg, #0a1628 0%, #1e3a8a 100%);
}

/* Fallback for browsers without WebGL */
.no-webgl #bg-canvas-container {
    background: linear-gradient(135deg, 
        #0a1628 0%, 
        #1a0a28 33%, 
        #0a2828 66%, 
        #0a0f1e 100%);
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    #bg-canvas-container {
        display: none;
    }
    
    body {
        background: linear-gradient(135deg, #0a1628 0%, #1e3a8a 100%);
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    section[data-bg-section] {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .content-overlay {
        padding: 1.5rem;
        margin: 0.5rem;
    }
}

/* Ensure text is always readable - white by default */
h1, h2, h3, h4, h5, h6, p, a, span {
    position: relative;
    z-index: 3;
    color: white;
}

/* Add subtle glow to important text */
.hero-title,
.section-title {
    text-shadow: 
        0 0 10px rgba(0, 217, 255, 0.3),
        0 0 20px rgba(0, 217, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Glassmorphism effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Smooth transitions for section changes */
section[data-bg-section] {
    transition: opacity 0.5s ease-in-out;
}

/* Blog Card Hover Effects */
.blog-card {
    transition: all 0.4s ease;
}

.blog-card .card-body * {
    transition: color 0.3s ease;
}

.blog-card:hover .card-body h2,
.blog-card:hover .card-body h2 a,
.blog-card:hover .card-body p,
.blog-card:hover .card-body span,
.blog-card:hover .card-body .text-dark,
.blog-card:hover .card-body .text-muted,
.blog-card:hover .card-body .fw-bold,
.blog-card:hover .post-meta *,
.blog-card:hover .post-tags *,
.blog-card:hover .post-stats * {
    color: white !important;
}

.blog-card:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.blog-card:hover .btn-primary {
    background: white;
    color: #667eea;
    border-color: white;
}

/* Accessibility: High contrast mode */
@media (prefers-contrast: high) {
    .content-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .glass-card {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}
