/**
 * Spacing & Navigation Fixes - February 2026 (AGGRESSIVE)
 *
 * Purpose: Dramatically reduce gaps and add kid-friendly navigation
 * Problem: Large padding creates huge gaps, no way to navigate back
 * Solution: Minimal padding, tight margins, colorful navigation buttons
 */

/* === AGGRESSIVE SPACING REDUCTION === */

.main-box {
    padding: 1rem 1.5rem !important;
    margin-bottom: 0.75rem !important; /* Reduced from 1.5rem */
}

.box1 {
    padding: 1rem 1.5rem !important;
    margin-bottom: 0.75rem !important; /* Reduced from 1.5rem */
}

.box2 {
    padding: 1rem 1.5rem !important;
    margin-bottom: 0.75rem !important;
}

/* === MINIMAL AD SPACING === */

.adbox {
    width: 100% !important;
    max-width: 970px !important;
    margin: 0.5rem auto !important; /* Further reduced from 0.75rem */
    padding: 0.15rem !important; /* Further reduced from 0.25rem */
}

/* Ads inside content boxes */
.ads-inline {
    margin: 1rem auto;
    padding: 0.75rem;
    background: rgba(248, 248, 248, 0.5);
    border-radius: 0.5rem;
    text-align: center;
}

.ads-inline::before {
    content: "Advertisement";
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section break ads */
.ads-section-break {
    margin: 1rem auto;
    padding: 0.75rem;
    max-width: 970px;
    background: linear-gradient(to bottom, rgba(248,248,248,0.3), rgba(248,248,248,0.6), rgba(248,248,248,0.3));
    border-radius: 0.5rem;
    text-align: center;
}

.ads-section-break::before {
    content: "Advertisement";
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === TIGHTER CONTENT FLOW === */

.page-sub-titles {
    margin-bottom: 0.5rem !important; /* Reduced from 0.75rem */
}

.main-box p, .box1 p, .box2 p {
    margin-bottom: 0.75rem;
}

.main-box p:last-child, .box1 p:last-child, .box2 p:last-child {
    margin-bottom: 0;
}

/* === KID-FRIENDLY NAVIGATION === */

/* Back to Category Navigation */
.back-to-category {
    width: 80%;
    max-width: 970px;
    margin: 1rem auto !important;
    padding: 1rem !important;
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.back-to-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.back-to-category a {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 0.75rem;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-to-category a:hover {
    background: #FFF3CD;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.back-to-category a::before {
    content: "← ";
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Category Grid Navigation (for footer) */
.category-navigation {
    width: 90%;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 1.0);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 1.2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.category-navigation h3 {
    text-align: center;
    color: #1a5f7a;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: none;
    letter-spacing: 0.5px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.category-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1rem;
    background: #4a90e2;
    color: white;
    text-decoration: none;
    border-radius: 0.8rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    min-height: 60px;
}

.category-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    filter: brightness(1.1);
}

/* Clean, professional colors for each category */
.category-button.mammals {
    background: #e85d75;
}

.category-button.birds {
    background: #4a90e2;
}

.category-button.reptiles {
    background: #50c878;
}

.category-button.amphibians {
    background: #f39c12;
}

.category-button.fish {
    background: #00bcd4;
}

.category-button.invertebrates {
    background: #9b59b6;
}

.category-button.extinct {
    background: #95a5a6;
}

/* === MOBILE OPTIMIZATION === */

@media (max-width: 768px) {
    .main-box, .box1, .box2 {
        padding: 0.75rem 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .adbox {
        margin: 0.35rem auto !important; /* Further reduced */
        padding: 0.1rem !important;
    }

    .ads-inline {
        margin: 0.75rem auto;
        padding: 0.5rem;
    }

    .back-to-category {
        padding: 0.75rem !important;
    }

    .back-to-category a {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .category-button {
        padding: 1rem 0.75rem;
        font-size: 1rem;
        min-height: 55px;
    }

    .category-navigation h3 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }
}

/* === CIRCULAR BUTTON SPACING === */

.animal-buttons {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.circle-buttons {
    margin: 0.5rem;
}

/* === QUICK FACTS BOX SPACING === */

.quick-facts-box {
    margin: 1rem auto !important;
}

/* === SMOOTHER TRANSITIONS === */

.main-box, .box1, .box2 {
    transition: all 0.3s ease;
}

.main-box:hover, .box1:hover, .box2:hover {
    box-shadow: 0.08vw 0.08vw 0.08vw rgba(0,0,0,0.3);
}
