.ft-marker-icon {
    background: transparent;
    border: 0;
}

.ft-marker-wrap {
    position: relative;
    width: 32px;
    height: 40px;
}

.ft-marker-base {
    position: absolute;
    inset: 0;
    width: 32px;
    height: 40px;
    display: block;
    pointer-events: none;
}

.ft-marker-glyph {
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    
    height: 20px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
}

.leaflet-control-attribution {
    font-size: 11px;
    line-height: 1.4;

    color: var(--text-muted);
    background: var(--bg-panel);
    border: 1px solid var(--status-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);

    padding: 4px 8px;
    border-radius: var(--radius-sm);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0.75;
    transition: opacity var(--transition-fast), transform var(--transition-slow), max-width var(--transition-fast);
    max-width: 100px;             
    overflow: hidden;
    white-space: nowrap;

    transform: translateX(40%);  
}

.leaflet-control-attribution:hover {
    max-width: 100%;
    transform: translateX(0);
    opacity: 1;
}

.leaflet-control-attribution a {
    color: var(--color-accent);
    text-decoration: none;
}

.leaflet-control-attribution a:hover {
    text-decoration: underline;
}

/* Tracking Panes, Index.php */
/* =========================
   TRACKING SECTION
   ========================= */
.tracked-animal-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
    margin-top: 8px;
}

.tracked-animal-top.init {
    height: 20px;
}

.tracked-animal-summary-card {
    flex: 1 1 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: start;
    background: var(--bg-panel, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    padding: 14px 16px;
    min-height: 30px;
    transition:
        flex-basis 1s ease,
        width 1s ease,
        max-width 1s ease;
}

.tracked-animal-top.has-animal .tracked-animal-summary-card {
    flex: 0 1 60%;
    max-width: 60%;
    margin-top: 0;
}

.tracked-animal-summary {
    line-height: 1.45;
    min-width: 0;
}

.tracked-animal-summary strong {
    font-size: 1.05rem;
    font-weight: 700;
}

.panel-info-species {
    opacity: 0.85;
    font-style: italic;
}

/* -------------------------
   IMAGE PANEL
------------------------- */

#panelProfileImage {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

#panelProfileImage.is-empty {
    display: none;
}

#panelProfileImage > .tracked-animal-image-frame {
    width: 100%;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    overflow: hidden;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    background: var(--bg-panel, rgba(255, 255, 255, 0.04));
}

#panelProfileImageImg,
.tracked-animal-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#panelProfileImageCaption {
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--text-main);
    opacity: 0.88;
}

/* -------------------------
   JOURNEY LOG
------------------------- */

#trackingTimelinePanel {
    flex: 0 0 0;
    width: 0;
    max-width: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    transition:
        flex-basis 1s ease,
        width 1s ease,
        max-width 1s ease;
}

.tracked-animal-top.has-animal #trackingTimelinePanel {
    flex: 0 1 40%;
    width: auto;
    max-width: 40%;
    min-width: 280px;
}

.tracking-timeline-header {
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    white-space: nowrap;
}

.tracking-timeline-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.tracking-timeline-empty {
    opacity: 0.8;
    font-style: italic;
    padding: 8px 4px;
}

.tracking-timeline-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-main);
    border: 1px solid transparent;
    border-radius: 10px;
    border-bottom: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition:
        background var(--transition-fast, 0.2s ease),
        border-color var(--transition-fast, 0.2s ease),
        box-shadow var(--transition-fast, 0.2s ease);
}

.tracking-timeline-item:hover {
    background: var(--bg-button-hover, rgba(255, 255, 255, 0.06));
    border-color: var(--status-border, rgba(255, 255, 255, 0.12));
}

.tracking-timeline-item.is-active {
    background: var(--bg-button-hover, rgba(255, 255, 255, 0.08));
    border-color: var(--color-accent, rgba(255, 255, 255, 0.3));
    box-shadow: 0 0 0 1px var(--color-accent, rgba(255, 255, 255, 0.2));
}

.tracking-timeline-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    font-weight: 600;
}

.tracking-timeline-index {
    opacity: 0.7;
    font-size: 0.92rem;
    white-space: nowrap;
}

.tracking-timeline-date {
    flex: 1;
}

.tracking-timeline-meta {
    font-size: 0.94rem;
    opacity: 0.85;
    line-height: 1.4;
}
/* -------------------------
   MAP
------------------------- */

.map-wrap {
    margin-top: 16px;
}

#map {
    width: 100%;
    height: 460px;
    min-height: 460px;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    border: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
}

/* -------------------------
   GALLERY
------------------------- */

.tracked-gallery-panel {
    margin-top: 16px;
    background: var(--bg-panel, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius-md, 12px);
    overflow: hidden;

    display: none; /* HIDDEN UNTIL IMPLEMENTED */
}

.tracked-gallery-header {
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--status-border, rgba(255, 255, 255, 0.12));
}

.tracked-gallery-body {
    padding: 14px 16px;
    opacity: 0.82;
}

/* -------------------------
   RESPONSIVE
------------------------- */

@media (max-width: 1100px) {
    .tracked-animal-top {
        grid-template-columns: 1fr;
    }

    .tracked-animal-summary-card {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    #trackingTimelinePanel {
        min-height: 260px;
    }

    #map {
        height: 400px;
        min-height: 400px;
    }
}

@media (max-width: 760px) {
    .tracked-animal-summary-card {
        grid-template-columns: 1fr;
    }

    #panelProfileImage {
        order: -1;
    }

    #panelProfileImage > .tracked-animal-image-frame {
        height: 200px;
        min-height: 200px;
        max-height: 200px;
    }

    #map {
        height: 340px;
        min-height: 340px;
    }
}
/* End Tracking Panes */

/* Trace Mode Toggle */
.trace-mode-toggle {
	display: inline-flex;
	gap: 0.35rem;
	margin-bottom: 0.85rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: var(--bg-panel-soft, rgba(255, 255, 255, 0.06));
	border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.trace-mode-button {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--text-muted, #b9c2cc);
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.trace-mode-button:hover {
	color: var(--text-main, #fff);
	background: rgba(255, 255, 255, 0.06);
}

.trace-mode-button.is-active {
	background: var(--color-accent, #63c7b2);
	color: var(--color-accent-contrast, #081412);
}
/* End Trace Mode Toggle */

/* IUCN Status */
.iucn {
font-size: 0.8em;
font-weight: 600;
}

.iucn-EX { color: var(--iucn-ex); }
.iucn-EW { color: var(--iucn-ew); }
.iucn-CR { color: var(--iucn-cr); }
.iucn-EN { color: var(--iucn-en); }
.iucn-VU { color: var(--iucn-vu); }
.iucn-NT { color: var(--iucn-nt); }
.iucn-LC { color: var(--iucn-lc); }
.iucn-DD { color: var(--iucn-dd); }
.iucn-NE { color: var(--iucn-ne); }
/* End IUCN Stauts */

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--color-panel);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
}

.leaflet-popup-content {
    color: var(--color-text);
}

.leaflet-popup-content strong {
    color: var(--color-heading);
}

.leaflet-popup-content em,
.leaflet-popup-content .ftline-sm,
.leaflet-popup-content .text-muted {
    color: var(--color-muted);
}

.leaflet-popup-close-button {
    color: var(--color-muted) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--color-accent) !important;
}

/* Zoom + Layer controls */
.leaflet-control-zoom,
.leaflet-control-layers {
    border: 1px solid var(--color-border) !important;
    background: var(--color-panel) !important;
    box-shadow: var(--shadow-soft);
}

/* Individual buttons */
.leaflet-control-zoom a,
.leaflet-control-layers-toggle {
    color: var(--color-text) !important;
    background-color: var(--color-panel) !important;
    background-repeat: no-repeat !important;
    background-position: 50% 50% !important;
}}

/* Remove last border line */
.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

/* Hover state */
.leaflet-control-zoom a:hover,
.leaflet-control-layers-toggle:hover {
    background: var(--color-bg-secondary) !important;
    color: var(--color-accent) !important;
}

/* Icons (the + / -) */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    font-weight: bold;
}

/* Layers dropdown panel */
.leaflet-control-layers-expanded {
    background: var(--color-panel) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
}

/* Checkbox / radio labels */
.leaflet-control-layers label {
    color: var(--color-text);
}
