/**
 * De Beste Bal - Custom CSS (supplements Tailwind)
 * Only for things Tailwind can't handle: Leaflet markers, animations, overrides
 */

/* ─── FONT OVERRIDE ─────────────────────────────────── */
.font-display, h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* ─── LEAFLET OVERRIDES ──────────────────────────────── */
.leaflet-container {
    background: #f8fafc;
    font-family: 'DM Sans', sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 220px;
}

.leaflet-popup-tip {
    box-shadow: none;
}

.leaflet-popup-close-button {
    color: #94a3b8 !important;
    font-size: 20px !important;
    padding: 6px 8px !important;
}

/* ─── REVIEWED MARKER ────────────────────────────────── */
.reviewed-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.reviewed-marker {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, .25),
        0 0 0 3px rgba(255, 255, 255, .9);
    transition: transform .15s ease;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -.02em;
}

.reviewed-marker:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.reviewed-marker .marker-icon {
    font-size: 10px;
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    line-height: 1;
}

/* ─── OSM MARKER (unreviewed, small dot) ─────────────── */
.osm-pill-wrapper {
    background: transparent !important;
    border: none !important;
}

.osm-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 3px 8px 3px 5px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    max-width: 160px;
}

.osm-pill:hover {
    border-color: #8B4513;
    color: #8B4513;
    box-shadow: 0 2px 8px rgba(139,69,19,.18);
    transform: scale(1.05);
}

.osm-pill-icon {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}

.osm-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── CLUSTER OVERRIDES ──────────────────────────────── */
.reviewed-cluster,
.osm-cluster-icon {
    background: transparent !important;
    border: none !important;
}

.marker-cluster {
    background: transparent !important;
}

.marker-cluster div {
    margin: 0 !important;
}

/* ─── POPUP INNER ────────────────────────────────────── */
.popup-inner {
    padding: 16px;
}

.popup-inner h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    margin: 0 0 4px;
    line-height: 1.3;
}

.popup-inner .popup-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.popup-inner .popup-score {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
}

.popup-inner a {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #8B4513;
    text-decoration: none;
}

.popup-inner a:hover {
    text-decoration: underline;
}

/* ─── FILTER CHIPS ───────────────────────────────────── */
.filter-chip {
    background: #fff;
    border-color: #e5e7eb;
    color: #6b7280;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: #d4d4d8;
    background: #f9fafb;
}

.filter-chip.active {
    background: #8B4513;
    border-color: #8B4513;
    color: #fff;
}

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(139, 69, 19, .4); }
    70% { box-shadow: 0 0 0 10px rgba(139, 69, 19, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 69, 19, 0); }
}

/* ─── RANGE SLIDER ───────────────────────────────────── */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8B4513;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    border: 2px solid #fff;
}

input[type=range]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8B4513;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

/* ─── SCROLLBAR HIDE ─────────────────────────────────── */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ─── MISC ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}

::selection {
    background: rgba(139, 69, 19, .15);
}

/* Smooth transitions on links */
a {
    transition: color .15s ease;
}

/* ─── ADMIN PANEL ────────────────────────────────────── */

/* CSS variables */
:root {
    --accent:      #8B4513;
    --accent-dark: #654321;
    --bg:          #f8f9fa;
    --surface:     #ffffff;
    --border:      #e9ecef;
    --text:        #1a1a2e;
    --text-muted:  #6c757d;
    --text-secondary: #495057;
    --green:       #198754;
    --green-bg:    #d1e7dd;
    --red:         #dc3545;
    --red-bg:      #f8d7da;
    --radius:      10px;
    --radius-sm:   6px;
    --sidebar-w:   230px;
}

/* Layout */
.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
}

/* Sidebar */
.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}

.admin-sidebar-link:hover {
    background: #f8f5f2;
    color: var(--accent);
    border-left-color: var(--accent);
    text-decoration: none;
}

.admin-sidebar-link.active {
    background: #fdf0e6;
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #8B4513, #c45e18);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Content area */
.admin-content {
    padding: 32px;
    max-width: 1100px;
}

.admin-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
}

.admin-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Card */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

/* Grid */
.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 768px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .grid--3, .grid--2 { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }
.admin-table a { color: var(--accent); font-weight: 500; text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }

/* Badges */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.admin-badge--approved  { background: #d1e7dd; color: #0f5132; }
.admin-badge--pending   { background: #fff3cd; color: #856404; }
.admin-badge--rejected  { background: #f8d7da; color: #842029; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .15s ease;
    font-family: 'DM Sans', sans-serif;
}

.btn--sm { padding: 5px 10px; font-size: 0.8rem; }

.btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn--secondary {
    background: #f8f9fa;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn--secondary:hover { background: #e9ecef; }

.btn--danger {
    background: #fff;
    color: var(--red);
    border-color: #f5c2c7;
}
.btn--danger:hover { background: #f8d7da; }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, .1);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .15s;
}

.pagination a:hover { background: #f8f5f2; border-color: var(--accent); color: var(--accent); }
.pagination a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 100px;
    border: 1.5px solid currentColor;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Misc */
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }
.text-muted { color: var(--text-muted) !important; }
.mb-2 { margin-bottom: 8px !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Route product checkboxes */
.route-product-chip { transition: all .15s; }
.route-product-chip:has(.route-product-cb:checked) {
    background: #fdf0e0 !important;
    border-color: #c47d38;
    color: #7c3a0e;
}

/* ─── HERO ANIMATIES ─────────────────────────────────── */

/* Zwevende ballen */
@keyframes floatBal {
    0%   { transform: translateY(0px) rotate(0deg); opacity: .55; }
    33%  { transform: translateY(-18px) rotate(5deg); opacity: .75; }
    66%  { transform: translateY(-8px) rotate(-4deg); opacity: .6; }
    100% { transform: translateY(0px) rotate(0deg); opacity: .55; }
}

.floating-bal {
    position: absolute;
    animation: floatBal 5s ease-in-out infinite;
    user-select: none;
}

/* Fade-in voor hero elementen */
@keyframes fadein {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.animate-fadein {
    animation: fadein .55s ease forwards;
}
