/* Geanimeerde Achtergrond voor Mandare - PULSE GRID */
/* Versie 5.0 - Dashboard tegels als achtergrond */

#animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #5B6AAF 0%, #3D4878 100%);
    overflow: hidden;
    z-index: -1;
    display: grid;
    grid-template-columns: repeat(var(--bg-cols, 6), 1fr);
    grid-template-rows: repeat(var(--bg-rows, 4), 1fr);
    gap: clamp(8px, 1vw, 16px);
    padding: clamp(12px, 1.5vw, 28px);
}

.bg-tile {
    border-radius: 10px;
    padding: clamp(8px, 0.8vw, 16px) clamp(10px, 1vw, 18px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'DM Sans', sans-serif;
    opacity: 0.18;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    transition: none;
    will-change: opacity, border-color, background;
    overflow: hidden;
}

.bg-tile.pulse {
    animation: bgTilePulse 7s ease-in-out forwards;
}

@keyframes bgTilePulse {
    0% {
        opacity: 0.18;
        border-color: rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.05);
    }
    8% {
        opacity: 0.8;
        border-color: rgba(140,160,220,0.5);
        background: rgba(140,160,220,0.12);
    }
    20% {
        opacity: 0.75;
        border-color: rgba(91,106,175,0.45);
        background: rgba(91,106,175,0.1);
    }
    45% {
        opacity: 0.7;
        border-color: rgba(61,72,120,0.4);
        background: rgba(61,72,120,0.09);
    }
    65% {
        opacity: 0.6;
        border-color: rgba(61,72,120,0.3);
        background: rgba(61,72,120,0.07);
    }
    85% {
        opacity: 0.3;
        border-color: rgba(61,72,120,0.15);
        background: rgba(61,72,120,0.05);
    }
    100% {
        opacity: 0.18;
        border-color: rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.05);
    }
}

.bg-tile .gt-label {
    font-size: clamp(10px, 0.85vw, 15px);
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bg-tile .gt-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.bg-tile .gt-value {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(22px, 2.4vw, 40px);
    color: rgba(255,255,255,0.75);
    line-height: 1;
}
.bg-tile .gt-icon {
    font-size: clamp(14px, 1.3vw, 22px);
    color: rgba(255,255,255,0.3);
}

/* Responsive grid */
@media (max-width: 1200px) { #animated-background { --bg-cols: 5; } }
@media (max-width: 900px)  { #animated-background { --bg-cols: 4; --bg-rows: 3; } }
@media (max-width: 768px)  { #animated-background { --bg-cols: 3; --bg-rows: 3; } }
@media (max-width: 480px)  { #animated-background { --bg-cols: 2; --bg-rows: 3; gap: 8px; padding: 12px; } }

/* Zorg dat content zichtbaar blijft */
body > *:not(#animated-background):not(.top-bar) {
    position: relative;
    z-index: 1;
}
