/* Template-specific styles for new hero background */
/* @import url('styles.css'); */ /* Commented for Vite build compatibility */

/* Override hero section styling for template */
.template-hero {
    position: relative;
    background: none !important; /* Remove original gradient */
    overflow: hidden;
}

.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./assets/hero-backgrounds/colorful-pug-clouds.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    filter: brightness(1.1) contrast(1.2) saturate(1.3);
    /* Smooth image loading */
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Fallback background in case image doesn't load */
.template-hero {
    background: linear-gradient(135deg, 
        #ff69b4 0%, 
        #6a5acd 25%, 
        #00bfff 50%, 
        #ffd700 75%, 
        #ff1493 100%
    );
}

/* Image loading states */
.hero-background-image {
    background-color: #663399; /* Fallback color matching the image */
}

/* Optional: Add subtle animated overlay for extra visual appeal (reduced opacity) */
.template-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(255, 0, 255, 0.05) 0%,
        rgba(0, 255, 255, 0.05) 25%,
        rgba(255, 255, 0, 0.05) 50%,
        rgba(255, 0, 255, 0.05) 75%,
        rgba(0, 255, 255, 0.05) 100%
    );
    background-size: 400% 400%;
    animation: gradient-shift 12s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

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

/* Ensure hero content stays visible */
.template-hero .hero-content {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced text shadows for better readability */
.template-hero h1:not(.holographic-text),
.template-hero p:not(.holographic-text) {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 0, 255, 0.5);
}

/* Floating animation for hero elements */
.template-hero .hero-content {
    animation: gentle-float 6s ease-in-out infinite;
}

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

/* Add some sparkle effects */
.template-hero .sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 2s ease-in-out infinite;
}

.template-hero .sparkle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.template-hero .sparkle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 0.5s;
}

.template-hero .sparkle:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 1s;
}

.template-hero .sparkle:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 1.5s;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .template-hero .hero-content {
        padding: 20px;
        margin: 10px;
    }
    
    .hero-background-image {
        background-position: center center;
        background-attachment: scroll; /* Better performance on mobile */
        filter: brightness(1.0) contrast(1.1) saturate(1.2); /* Reduce filters for mobile */
    }
    
    /* Reduce animated overlay intensity on mobile */
    .template-hero::before {
        opacity: 0.5;
        animation-duration: 15s; /* Slower animation for battery savings */
    }
}

@media (max-width: 480px) {
    .template-hero .hero-content {
        padding: 15px;
        margin: 5px;
    }
    
    .hero-background-image {
        background-size: cover;
        background-position: center center;
    }
    
    /* Minimal overlay on small screens */
    .template-hero::before {
        opacity: 0.3;
    }
}

/* High-DPI displays optimization */
@media (min-resolution: 2dppx) {
    .hero-background-image {
        /* Consider using a higher resolution image for retina displays */
        background-image: url('./assets/hero-backgrounds/colorful-pug-clouds.jpg');
    }
}

/* $DIABLO LEGEND Section with Colorful Cloud Background */
.diablo-story {
    position: relative;
    background: none !important; /* Remove original background */
    overflow: hidden;
    min-height: 100vh;
}

.diablo-story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./assets/hero-backgrounds/colorful-pug-clouds.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    filter: brightness(0.8) contrast(1.1) saturate(1.2);
    opacity: 0.9;
}

/* Add subtle overlay for better text readability */
.diablo-story::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(138, 43, 226, 0.3) 25%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(75, 0, 130, 0.3) 75%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* Enhanced readability for story content */
.diablo-story .container {
    position: relative;
    z-index: 1;
}

.diablo-story .story-header,
.diablo-story .story-content {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.diablo-story .story-title:not(.holographic-text) {
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(255, 0, 255, 0.7),
        0 0 60px rgba(0, 255, 255, 0.5);
}

.diablo-story .story-text p {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(255, 255, 255, 0.3);
}

.diablo-story .chapter-title {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(255, 215, 0, 0.6);
}

/* Language tabs enhancement */
.diablo-story .story-language-tabs {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ULTIMATE HOLOGRAPHIC TEXT FIX - Maximum Specificity */
html body .holographic-text,
html body h1.holographic-text,
html body h2.holographic-text,
html body .hero-title.holographic-text,
html body .hero-subtitle.holographic-text,
html body .story-title.holographic-text,
html body .section-title.holographic-text {
    background: linear-gradient(45deg, 
        #ff00ff 0%,    /* Magenta */
        #00ff00 25%,   /* Green */ 
        #00ffff 50%,   /* Cyan */
        #ffff00 75%,   /* Yellow */
        #ff00ff 100%   /* Back to Magenta */
    ) !important;
    background-size: 400% 400% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    filter: drop-shadow(0 0 30px #ff00ff) !important;
    animation: holographic-rainbow 3s ease-in-out infinite !important;
}

/* Ensure the animation exists */
@keyframes holographic-rainbow {
    0%, 100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 30px #ff00ff);
    }
    25% {
        background-position: 25% 50%;
        filter: drop-shadow(0 0 30px #00ff00);
    }
    50% {
        background-position: 100% 50%;
        filter: drop-shadow(0 0 30px #00ffff);
    }
    75% {
        background-position: 75% 50%;
        filter: drop-shadow(0 0 30px #ffff00);
    }
}

/* ULTIMATE HOLOGRAPHIC TEXT FIX - Maximum specificity to override everything */
html body section.template-hero div.container div.hero-title-wrapper h1.hero-title.holographic-text,
html body section.template-hero div.container div.hero-title-wrapper h2.hero-subtitle.holographic-text,
html body section.diablo-story div.container div.story-header h2.section-title.holographic-text.story-title,
html body section.diablo-story h2.story-title.holographic-text,
html body .template-hero .hero-title.holographic-text,
html body .template-hero .hero-subtitle.holographic-text,
html body .diablo-story .story-title.holographic-text,
html body .diablo-story .section-title.holographic-text,
html body .holographic-text.hero-title,
html body .holographic-text.hero-subtitle,
html body .holographic-text.story-title,
html body h1.holographic-text,
html body h2.holographic-text {
    background: linear-gradient(45deg, 
        #ff00ff 0%, 
        #00ff00 25%, 
        #00ffff 50%, 
        #ffff00 75%, 
        #ff00ff 100%) !important;
    background-size: 400% 400% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    filter: drop-shadow(0 0 30px #ff00ff) drop-shadow(0 0 60px #00ffff) !important;
    animation: holographic-rainbow 3s ease-in-out infinite !important;
    animation-fill-mode: both !important;
}

/* Enhanced rainbow animation with more dramatic effect */
@keyframes holographic-rainbow {
    0% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 30px #ff00ff) drop-shadow(0 0 60px #ff00ff);
    }
    25% {
        background-position: 25% 50%;
        filter: drop-shadow(0 0 30px #00ff00) drop-shadow(0 0 60px #00ff00);
    }
    50% {
        background-position: 100% 50%;
        filter: drop-shadow(0 0 30px #00ffff) drop-shadow(0 0 60px #00ffff);
    }
    75% {
        background-position: 75% 50%;
        filter: drop-shadow(0 0 30px #ffff00) drop-shadow(0 0 60px #ffff00);
    }
    100% {
        background-position: 0% 50%;
        filter: drop-shadow(0 0 30px #ff00ff) drop-shadow(0 0 60px #ff00ff);
    }
}

/* Make sure no other styles can override */
.story-title.holographic-text,
.hero-title.holographic-text,
.hero-subtitle.holographic-text {
    background: linear-gradient(45deg, 
        #ff00ff 0%, 
        #00ff00 25%, 
        #00ffff 50%, 
        #ffff00 75%, 
        #ff00ff 100%) !important;
    background-size: 400% 400% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    animation: holographic-rainbow 3s ease-in-out infinite !important;
}

/* Mobile responsiveness for DIABLO LEGEND section */
@media (max-width: 768px) {
    .diablo-story::before {
        background-attachment: scroll; /* Better performance on mobile */
        filter: brightness(0.7) contrast(1.0) saturate(1.1); /* Reduce intensity */
    }
    
    .diablo-story .story-header,
    .diablo-story .story-content {
        padding: 20px;
        margin-bottom: 15px;
        backdrop-filter: blur(10px); /* Reduce blur for performance */
    }
    
    .diablo-story .story-language-tabs {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .diablo-story {
        min-height: auto; /* Allow natural height on small screens */
    }
    
    .diablo-story::before {
        background-position: center center;
        filter: brightness(0.6) contrast(1.0) saturate(1.0); /* Further reduce for readability */
    }
    
    .diablo-story .story-header,
    .diablo-story .story-content {
        padding: 15px;
        margin-bottom: 10px;
        backdrop-filter: blur(5px); /* Minimal blur for performance */
    }
    
    .diablo-story .story-language-tabs {
        padding: 10px;
    }
    
    /* Increase text contrast on small screens */
    .diablo-story::after {
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(138, 43, 226, 0.4) 25%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(75, 0, 130, 0.4) 75%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }
}