/* Placeholder Image Fix */
/* Add this CSS to handle missing images with styled placeholders */

/* Default placeholder for missing images */
img {
    background-color: var(--light-gray);
    border: 2px dashed var(--gray);
    display: block;
    position: relative;
    min-height: 200px;
}

/* Placeholder text overlay */
img::before {
    content: "🍌 DK Image";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-brown);
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 1;
}

/* Hide placeholder content when image loads */
img:not([src=""]):not([src]) {
    background: var(--banana-yellow);
}

/* Specific placeholder styling for different image types */
.hero-image img {
    min-height: 400px;
    background: linear-gradient(135deg, var(--primary-brown), var(--banana-yellow));
    border-radius: 10px;
}

.hero-image img::before {
    content: "🦍 Donkey Kong\A🍌 Bananza";
    white-space: pre;
    text-align: center;
    font-size: 2rem;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.story-image img {
    min-height: 300px;
    background: linear-gradient(45deg, var(--jungle-green), var(--primary-brown));
    border-radius: 10px;
}

.story-image img::before {
    content: "🏞️ Adventure\A🎭 Story";
    white-space: pre;
    text-align: center;
    font-size: 1.5rem;
    color: var(--white);
}

.transformation-image img {
    min-height: 200px;
    background: linear-gradient(45deg, var(--action-red), var(--banana-yellow));
    border-radius: 10px;
}

.transformation-image img::before {
    content: "✨ Transform";
    font-size: 1.2rem;
    color: var(--white);
}

.character-image img {
    min-height: 150px;
    background: linear-gradient(45deg, var(--banana-yellow), var(--jungle-green));
    border-radius: 50%;
}

.character-image img::before {
    content: "👤 Character";
    font-size: 1rem;
    color: var(--primary-brown);
}

.game-image img {
    min-height: 200px;
    background: linear-gradient(45deg, var(--jungle-green), var(--action-red));
    border-radius: 10px;
}

.game-image img::before {
    content: "🎮 Game";
    font-size: 1.2rem;
    color: var(--white);
}

/* Remove default img styling when actual image loads */
img[src]:not([src=""]) {
    background: none !important;
    border: none !important;
    min-height: auto !important;
}

img[src]:not([src=""])::before {
    display: none !important;
}

/* Ensure actual images display properly */
img[src*="hero-donkey-kong.webp"],
img[src*="story-background.jpg"],
img[src*="kong-transformation.jpg"],
img[src*="donkey-kong-character.png"] {
    background: none !important;
    border: none !important;
    min-height: auto !important;
}

img[src*="hero-donkey-kong.webp"]::before,
img[src*="story-background.jpg"]::before,
img[src*="kong-transformation.jpg"]::before,
img[src*="donkey-kong-character.png"]::before {
    display: none !important;
}

/* Additional layout fixes */
.intro-content {
    align-items: flex-start;
}

.story-content {
    align-items: flex-start;
}

.community-content {
    align-items: flex-start;
}

/* Ensure sections have proper spacing */
section {
    min-height: auto;
    padding: 60px 0;
}

.hero {
    min-height: 80vh;
}

/* Fix empty space in grids */
.features-grid,
.transformations-grid,
.characters-grid,
.games-grid {
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Ensure cards have consistent height */
.feature-card,
.transformation-card,
.character-card,
.game-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Video container fallback */
.video-container {
    background: linear-gradient(45deg, var(--primary-brown), var(--banana-yellow));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    text-align: center;
}

.video-container::before {
    content: "🎥 Donkey Kong Bananza\AOfficial Trailer";
    white-space: pre;
    line-height: 1.5;
}

/* Hide fallback when iframe loads */
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Ensure proper spacing between sections */
.container {
    padding: 0 20px;
}

@media (max-width: 768px) {
    .hero-image img::before {
        font-size: 1.5rem;
    }
    
    .story-image img::before {
        font-size: 1.2rem;
    }
    
    .feature-card,
    .transformation-card,
    .character-card,
    .game-card {
        min-height: 250px;
    }
    
    section {
        padding: 40px 0;
    }
}