:root {
    --primary-color: #1a237e;
    --secondary-color: #ff7043;
    --light-color: #f5f7fa;
    --text-color: #263238;
    --panel-bg: #fff;
    --panel-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    --panel-radius: 18px;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
    --transition: 0.4s cubic-bezier(.4,0,.2,1);
}

html, body {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
    height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
    background: linear-gradient(135deg, #e3e9f7 0%, #f5f7fa 100%);
    color: var(--text-color);
}

body {
    font-family: var(--font-body);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
}

header {
    background: linear-gradient(100deg, var(--primary-color) 60%, #3949ab 100%);
    color: var(--light-color);
    padding: 2.2em 0 1.5em 0;
    text-align: center;
    box-shadow: 0 6px 24px rgba(26,35,126,0.13), 0 1.5px 8px rgba(44,62,80,0.06);
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
    margin-bottom: 0.7em;
    letter-spacing: 1px;
    z-index: 200;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
}

header .flo-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

header .flo-header-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 0.2em;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(255,112,67,0.18));
    animation: pawBounce 1.6s infinite cubic-bezier(.4,0,.2,1);
}

@keyframes pawBounce {
    0%, 100% { transform: translateY(0);}
    20% { transform: translateY(-10px);}
    40% { transform: translateY(0);}
    60% { transform: translateY(-6px);}
    80% { transform: translateY(0);}
}

header h1 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 2.3em;
    text-shadow: 0 4px 18px rgba(26,35,126,0.10), 0 2px 8px rgba(26,35,126,0.08);
    line-height: 1.18;
    letter-spacing: 1.2px;
    font-weight: 700;
    background: linear-gradient(90deg, #ff7043 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .flo-header-sub {
    font-family: var(--font-body);
    font-size: 1.08em;
    color: #ffe0b2;
    margin-top: 0.2em;
    letter-spacing: 0.2px;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(26,35,126,0.10);
}

.container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    min-width: 0;
    position: relative;
    background: none;
    margin: 0;
    padding: 0;
    overflow: visible;
}

#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none;
    margin: 0;
    padding: 0;
    display: block;
    z-index: 1;
    transition: filter 0.3s;
    touch-action: none;
    background: #e3e9f7;
}

#map.panel-open {
    filter: blur(2px) brightness(0.95);
}

#story-panel {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    height: 0;
    max-height: 80vh;
    background: linear-gradient(135deg, #fff 80%, #f5f7fa 100%);
    box-shadow: 0 -8px 40px 0 rgba(31,38,135,0.18), 0 2px 16px 0 rgba(44,62,80,0.08);
    border-radius: 28px 28px 0 0;
    z-index: 1002;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: height var(--transition), padding var(--transition);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0.99;
    outline: none;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}

#story-panel.story-panel-visible {
    height: 65vh;
    max-height: 80vh;
    padding: 28px 18px 24px 18px;
    animation: slideInPanel 0.5s cubic-bezier(.4,0,.2,1), panelFadeIn 0.5s cubic-bezier(.4,0,.2,1);
    max-width: 540px;
    margin: 0 auto;
    left: 0; right: 0;
}

@keyframes slideInPanel {
    from { transform: translateY(100%); opacity: 0.5;}
    to { transform: translateY(0); opacity: 1;}
}

#story-panel h2, #story-panel #story-title {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.25em;
    margin-bottom: 0.15em;
    letter-spacing: 0.5px;
    line-height: 1.1;
    text-align: center;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(26,35,126,0.06);
}

#story-panel #story-date {
    font-size: 1.08em;
    color: #7f8c8d;
    margin-bottom: 18px;
    font-style: italic;
    letter-spacing: 0.2px;
    text-align: center;
}

#story-panel #story-photo {
    width: 75vw;
    max-width: 75vw;
    height: auto;
    max-height: 48vh;
    min-height: 120px;
    object-fit: contain;
    border-radius: 22px;
    margin-bottom: 22px;
    box-shadow: none !important;   /* <-- Verwijder schaduw */
    border: none !important;       /* <-- Verwijder border */
    background: none !important;   /* <-- Verwijder achtergrond */
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: box-shadow 0.3s;
}

#story-panel #story-text {
    font-size: 1em;
    text-align: left;
    color: var(--text-color);
    margin-bottom: 0;
    line-height: 1.8;
    letter-spacing: 0.12px;
    padding-bottom: 8px;
    word-break: break-word;
    margin-top: 18px;
    display: block;
    background: rgba(245,247,250,0.7);
    border-radius: 12px;
    padding: 18px 14px 18px 14px;
    box-shadow: 0 2px 8px rgba(26,35,126,0.04);
}

#close-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    border: none;
    font-size: 2.2em;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 8px rgba(255,112,67,0.10);
    transition: background 0.2s, transform 0.15s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    border: 2px solid #fff;
}
#close-panel-btn:hover, #close-panel-btn:focus {
    background: #ff8a65;
    transform: scale(1.08) rotate(8deg);
    outline: none;
}

@media (max-width: 600px) {
    #close-panel-btn {
        font-size: 1.3em;
        width: 34px;
        height: 34px;
        top: 8px;
        right: 8px;
    }
}
@media (max-width: 400px) {
    #close-panel-btn {
        font-size: 1.1em;
        width: 26px;
        height: 26px;
        top: 6px;
        right: 6px;
    }
}

/* --- Custom Leaflet Popup Styling --- */
.leaflet-popup-content-wrapper {
    background: #fff;
    color: var(--text-color);
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(31,38,135,0.13), 0 1.5px 8px rgba(44,62,80,0.06);
    border: 2px solid var(--primary-color);
    padding: 0;
    margin: 0;
    font-family: var(--font-body);
    min-width: 180px;
    max-width: 320px;
    animation: popupFadeIn 0.35s cubic-bezier(.4,0,.2,1);
}

@keyframes popupFadeIn {
    from { transform: translateY(16px) scale(0.95); opacity: 0.5;}
    to { transform: translateY(0) scale(1); opacity: 1;}
}

.leaflet-popup-content {
    margin: 0;
    padding: 18px 18px 12px 18px;
    font-size: 1.08em;
    color: var(--text-color);
    text-align: left;
    line-height: 1.5;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
}

.leaflet-popup-content h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 1.18em;
    margin: 0 0 6px 0;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-align: left;
}

.leaflet-popup-content p {
    margin: 0 0 2px 0;
    color: var(--text-color);
    font-size: 1em;
    line-height: 1.5;
}

.leaflet-popup-tip {
    background: var(--primary-color);
}

.leaflet-popup-close-button {
    color: var(--secondary-color);
    font-size: 1.6em;
    font-weight: bold;
    top: 8px;
    right: 12px;
    opacity: 0.85;
    transition: color 0.2s;
}
.leaflet-popup-close-button:hover {
    color: #ff8a65;
    opacity: 1;
}

.leaflet-marker-icon {
    filter: drop-shadow(0 2px 6px rgba(26,35,126,0.13));
}

footer {
    background: linear-gradient(90deg, var(--primary-color) 60%, #3949ab 100%);
    color: var(--light-color);
    text-align: center;
    padding: 1em 0 0.7em 0;
    font-size: 1em;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    margin-top: 0;
    box-shadow: 0 -2px 8px rgba(26,35,126,0.08);
    width: 100vw;
    position: relative;
    z-index: 100;
}

/* Custom paw-marker style */
.paw-marker {
    transition: transform 0.25s cubic-bezier(.4,0,.2,1), filter 0.25s;
    filter: drop-shadow(0 2px 8px rgba(255,112,67,0.18));
    will-change: transform;
}
.paw-marker-hover {
    transform: scale(1.18) rotate(-8deg);
    filter: drop-shadow(0 6px 18px rgba(255,112,67,0.25));
    z-index: 10;
}

/* Extra responsive tweaks */
@media (max-width: 900px) {
    #story-panel.story-panel-visible {
        max-width: 98vw;
        padding: 18px 6vw 18px 6vw;
        /* Voeg extra margin-top toe zodat het panel niet over de header heen schuift */
        margin-top: 120px; /* verhoog margin zodat panel lager begint */
        max-height: 75vh;
    }
}
@media (max-width: 600px) {
    #story-panel.story-panel-visible {
        height: 60vh;
        max-height: 75vh;
        padding: 10px 2vw 10px 2vw;
        max-width: 100vw;
        margin-top: 120px; /* verhoog margin zodat panel lager begint */
    }
    #story-panel #story-title, #story-panel h2 {
        font-size: 1em;
    }
    #story-panel #story-photo {
        width: 75vw;
        max-width: 75vw;
        max-height: 38vh;
        min-height: 80px;
    }
    #story-panel #story-text {
        font-size: 0.95em;
    }
}
@media (max-width: 400px) {
    #story-panel.story-panel-visible {
        height: 65vh;
        max-height: 75vh;
        padding: 4px 1vw 4px 1vw;
        margin-top: 100px; /* verhoog margin zodat panel lager begint */
    }
}

/* Landscape mode op mobiel: panel minder hoog */
@media (max-width: 900px) and (orientation: landscape) {
    #story-panel.story-panel-visible {
        height: 50vh;
        max-height: 60vh;
    }
}

/* iOS notch fix */
@media (max-width: 768px) {
    body, html {
        padding-bottom: env(safe-area-inset-bottom);
        padding-top: env(safe-area-inset-top);
    }
    #story-panel {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

::-webkit-scrollbar {
    width: 8px;
    background: #e3e9f7;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb {
    background: #b0bec5;
    border-radius: 8px;
}

/* Header with Flo image styles */
.flo-header-with-floimg {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.2em;
    /* inherit background, border-radius, etc. from .flo-header-inner */
}

.flo-header-inner.flo-header-with-floimg {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.2em;
}

.flo-header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    gap: 0.2em;
}

.flo-header-floimg {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(255,112,67,0.13);
    border: 2.5px solid #fff;
    background: #ffe0b2;
    margin-left: 0.5em;
    margin-right: 0.2em;
    display: block;
}

@media (max-width: 700px) {
    header {
        padding: 1.2em 0 1em 0;
        border-bottom-left-radius: 18px;
        border-bottom-right-radius: 18px;
        margin-bottom: 0.5em;
    }
    .flo-header-inner.flo-header-with-floimg {
        flex-direction: column;
        gap: 0.5em;
        align-items: center;
        justify-content: center;
    }
    .flo-header-text {
        align-items: center;
        text-align: center;
        width: 100%;
    }
    .flo-header-text h1 {
        font-size: 1.5em;
        margin: 0.2em 0 0.1em 0;
        line-height: 1.2;
        text-align: center;
        background: linear-gradient(90deg, #ff7043 0%, #fff 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .flo-header-sub {
        font-size: 1em;
        color: #ffe0b2;
        text-align: center;
        margin-bottom: 0.2em;
    }
    .flo-header-floimg {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        margin: 0.2em auto 0 auto;
    }
    .container {
        padding: 0;
        margin: 0;
        width: 100vw;
    }
    .about-main-row, .about-section {
        max-width: 420px;
        width: 95vw;
        margin-left: auto;
        margin-right: auto;
    }
    .fab-stats, .fab-about {
        width: 44px;
        height: 44px;
    }
    .fab-stats {
        left: 10px;
        bottom: 70px;
    }
    .fab-about {
        left: 10px;
        bottom: 16px;
    }
    .fab-home {
        left: 10px;
        top: 10px;
        width: 38px;
        height: 38px;
    }
    .stats-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px 0 0 0;
    }
    .stats-graph-card {
        min-width: 0;
        width: 98vw;
        max-width: 99vw;
        margin: 0 auto;
        padding: 14px 4px 14px 4px;
        border-radius: 14px;
        grid-column: span 1;
    }
    .stats-card {
        min-width: 0;
        width: 98vw;
        max-width: 99vw;
        margin: 0 auto;
        padding: 12px 4px 12px 4px;
        border-radius: 14px;
    }
    .stats-card h2, .stats-graph-card h2 {
        font-size: 1em;
    }
    .stats-value {
        font-size: 1.5em;
    }
}

@media (max-width: 400px) {
    .stats-card, .stats-graph-card {
        padding: 8px 1px 8px 1px;
        border-radius: 12px;
    }
    .stats-value {
        font-size: 1em;
    }
    .fab-home, .fab-stats {
        width: 28px;
        height: 28px;
    }
    .flo-header-text h1 {
        font-size: 1.1em;
    }
}

/* Statistics Page Styles */
.stats-nav {
    margin: 20px 0;
}

.stats-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: background-color 0.3s;
}

.stats-nav a:hover {
    background-color: #e0e0e0;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.stats-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.stats-card p {
    color: #666;
    margin: 0;
    font-size: 0.9em;
}

/* Stats Button op homepagina */
.stats-btn {
    display: inline-block;
    margin: 18px auto 0 auto;
    padding: 12px 32px;
    background: linear-gradient(90deg, #1a237e 60%, #ff7043 100%);
    color: #fff;
    font-size: 1.15em;
    font-weight: 600;
    border: none;
    border-radius: 32px;
    box-shadow: 0 2px 12px rgba(26,35,126,0.10);
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.stats-btn:hover {
    background: linear-gradient(90deg, #ff7043 0%, #1a237e 100%);
    transform: translateY(-2px) scale(1.04);
}

/* Gelijke hoogte en uitlijning voor dashboard blokken */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2em;
    margin: 0 auto;
    max-width: 1200px;
    padding: 2em 0.5em 80px 0.5em;
}
.stats-graph-card {
    min-height: 420px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 48px 32px 38px 32px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(26,35,126,0.07);
    margin: 0;
    grid-column: span 2;
}
.stats-card {
    min-height: 180px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 28px 22px 22px 22px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(26,35,126,0.07);
    margin: 0;
}
.stats-card h2, .stats-graph-card h2 {
    width: 100%;
    text-align: center;
}

@media (max-width: 1200px) {
    .stats-graph-card {
        min-height: 340px;
        padding: 28px 10px 28px 10px;
        grid-column: span 1;
    }
}
@media (max-width: 900px) {
    .stats-graph-card {
        min-height: 200px;
        padding: 18px 6px 18px 6px;
        grid-column: span 1;
    }
}
@media (max-width: 700px) {
    .stats-graph-card {
        min-height: 140px;
        padding: 14px 4px 14px 4px;
        border-radius: 14px;
        grid-column: span 1;
    }
}
@media (max-width: 400px) {
    .stats-graph-card {
        min-height: 90px;
        padding: 8px 1px 8px 1px;
        border-radius: 10px;
        grid-column: span 1;
    }
}

/* Floating Action Button voor stats (linksonder) */
.fab-stats {
    position: fixed;
    bottom: 88px;
    left: 24px;
    right: auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(255,112,67,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.fab-about {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26,35,126,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.fab-about:hover, .fab-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26,35,126,0.4);
}

.fab-about svg, .fab-stats svg {
    width: 32px;
    height: 32px;
}

/* Floating Action Button voor home (linksboven op stats) */
.fab-home {
    position: fixed;
    left: 24px;
    top: 24px;
    width: 44px;
    height: 44px;
    background: #1a237e;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(26,35,126,0.13);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    opacity: 0.95;
}
.fab-home:hover {
    box-shadow: 0 8px 32px rgba(26,35,126,0.18);
    transform: scale(1.08);
    opacity: 1;
}
.fab-home svg {
    display: block;
}

@media (max-width: 700px) {
    .stats-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px 0 0 0;
    }
    .stats-graph-card, .stats-card {
        min-width: 0;
        width: 98vw;
        max-width: 99vw;
        margin: 0 auto;
        padding: 18px 6px 18px 6px;
        box-sizing: border-box;
    }
    .stats-card h2, .stats-graph-card h2 {
        font-size: 1em;
    }
    .stats-value {
        font-size: 1.5em;
    }
    .fab-home {
        left: 10px;
        top: 10px;
        width: 38px;
        height: 38px;
    }
    .fab-stats {
        left: 10px;
        bottom: 70px;
        width: 44px;
        height: 44px;
    }
    .fab-about {
        left: 10px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 400px) {
    .stats-card, .stats-graph-card {
        padding: 10px 2px 10px 2px;
    }
    .stats-value {
        font-size: 1.1em;
    }
    .fab-home, .fab-stats {
        width: 32px;
        height: 32px;
    }
}