/* Sidenav Home List */
.sidenav-home-list,
.sidenav-area-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidenav-home-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    background-color: white;
}

.sidenav-home-item:hover {
    background-color: #f5f5f5;
}

.sidenav-home-item .area-name {
    font-weight: 500;
}

.sidenav-home-item.back-item {
    background-color: #f0f8ff;
    color: #003366;
    justify-content: flex-start;
    gap: 10px;
    font-weight: bold;
}

/* Increase font size for sidenav content by 50% */
/* Font size increase removed as per user feedback */

/* Specific fix for the legend so it doesn't get double scaled or looks weird */
#sidenavContentId .sidenav-home-item {
    font-size: 14px !important;
    /* Keep the list items normal if mixed? No, apply to detail view mostly */
}

/* But user said "Fonti v sidenav naj bodo 50 % višji" which implies everything */
/* Let's be careful. The table content is main. */
.track-info-content1,
.track-info-content2,
.track-info-content0 {
    font-size: 1.1em;
    /* already slightly styled */
}

/* Small font for tour lists in sidenav */
.small-font-list,
.small-font-list table,
.small-font-list div,
.small-font-list span,
.small-font-list td {
    font-size: 11px !important;
}

/* Expandable Description */
.desc-container {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.desc-container.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    max-height: 4.8em;
    /* Force height limit approx 3-4 lines */
    line-height: 1.5em;
    /* Define line height to match calculations */
}

.desc-toggle-btn {
    color: #3498db;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: bold;
}

.desc-toggle-btn:hover {
    text-decoration: underline;
}

/* Larger Elevation Button */
/* Larger Elevation Button */
#sidenavHeightButtonId {
    font-size: 1.5em !important;
    /* Scale icon and text */
    width: 40px;
    /* Ensure enough space */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    border: 1px solid #ccc;
    /* Explicit border */
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* Enlarge GPX Button */
.gpx-download-button {
    font-size: 1.5em !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    border: 1px solid #ccc;
    /* Explicit border */
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.gpx-download-gpx {
    font-size: 0.6em;
    /* Adjust for centered text */
    font-weight: bold;
    position: static;
    /* Center in flex container */
    color: #555;
    /* Visible color */
}

.small-title {
    font-size: 1em !important;
    /* Reduce font size in lists */
}

/* Larger Elevation Profile */
.elevation canvas,
.elevation svg,
.separate-elevation canvas,
.separate-elevation svg {
    /* Scaling the content */
    /* Note: if using ol-ext, it handles resizing. transform might blur. */
    /* Increasing container height might be better if canvas is responsive. */
}

.elevation,
.separate-elevation {
    /* Scaling removed as per user feedback - it was too large on phones */
}

#sidenavElevationId.elevation {
    /* Scaling removed - using natural width */
    width: 100% !important;
}

/* Custom Background Colors */
.info-content-subtitle {
    background-color: #e6f7ff !important;
    /* Very light blue */
    padding: 8px;
    /* Add some padding for better look */
    border-radius: 4px;
}

.description-field {
    background-color: #fffff0 !important;
    /* Very light yellow */
    padding: 8px;
    border-radius: 4px;
    /* display: block; REMOVED - breaks table layout on td */
    /* width: 100%; REMOVED - default table cell behavior is fine */
    box-sizing: border-box;
    border: 1px solid #f0f0e0;
    /* Subtle border to help visibility */
}

/* Ensure desc-container respects the padding */
.desc-container {
    background-color: transparent;
    /* Rely on parent */
    padding: 0;
    padding: 0;
    /* padding handled by td */
}

/* Ski Mode Toggle Button */
#skiModeToggleId {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2000;
}

#skiModeButtonId {
    font-size: 1.5em !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#skiModeButtonId:hover {
    background-color: #f0f0f0;
}

/* AK: Mobile Bottom Sheet Layout */
@media only screen and (max-width: 768px) {

    /* Position the container at the bottom */
    #sidenavContainerId {
        position: fixed !important;
        /* AK: Fixed positioning essential for bottom sheet */
        width: 100% !important;
        max-width: 100% !important;
        height: 90vh;
        /* Large height by default when opened */
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;

        border-radius: 20px 20px 0 0;
        /* Rounded top */
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2) !important;
        z-index: 15000;
        /* High z-index */

        /* transition: height 0.3s ease-in-out; removed to avoid jitter during drag */
    }

    /* Shrinked state (Small bottom sheet) */
    #sidenavContainerId.shrinked {
        height: 33vh;
    }

    /* Target the horizontal handle on mobile */
    .sidenav-close-strip-line {
        display: block !important;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background-color: #ccc;
        border-radius: 5px;
        cursor: pointer;
        z-index: 16000;
        pointer-events: none; /* Let parent handle the touch */
        margin-top: 15px;
    }

    /* Increase parent touch target */
    .sidenav-close-strip-front {
        height: 60px !important;
        /* AK: Much larger touch area for dragging */
        z-index: 17000;
        cursor: row-resize;
    }

    /* AK: Aggressive Mobile Font Reductions (Cache Busted) */
    #sidenavContentId, 
    #sidenavContentId table,
    #sidenavContentId td,
    #sidenavContentId span {
        font-size: 12px !important;
    }

    .track-info-title {
        font-size: 14px !important;
    }

    .track-details-container,
    .track-details-container td,
    .track-details-container span {
        font-size: 11px !important;
    }

    /* THE ABSOLUTE FINAL FIX FOR START/END POINTS */
    .point-start-finish,
    span.point-start-finish,
    td.point-start-finish,
    #sidenavContentId .point-start-finish {
        font-size: 10px !important;
        font-weight: normal !important;
        display: inline-block !important;
        color: #444 !important; /* Slightly dimmer to emphasize smallness */
    }
    .sidenav-close-strip-front.for-shrink {
        height: 40px !important;
        top: 0 !important;
        background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0));
        border-radius: 20px 20px 0 0;
    }

    /* Hide text or arrows inside handle on mobile */
    .sidenav-close-strip-line i {
        display: none !important;
    }

    /* Inner envelope to match */
    .sidenav-envelope {
        width: 100% !important;
        height: 100% !important;
        border-radius: 20px 20px 0 0;
        overflow: hidden;
    }

    /* Remove desktop styles from inner container */
    #sidenavInnerContainerId {
        width: 100% !important;
        height: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* Ensure content scrolls correctly within the smaller height */
    .sidenav-content {
        height: calc(100% - 50px) !important;
        /* Adjust for header */
        padding-bottom: 20px;
    }

    /* Hide the desktop toggle button if it gets in the way */
    #sidenavToggleId {
        display: none !important;
    }

    /* Adjust specific elements for the small vertical space */
    .sidenav-command-strip {
        padding: 5px 10px;
        min-height: 40px;
    }

    /* Ensure close button (if visible) is positioned correctly or hidden */
    #sidenavCloseBtnId {
        top: -40px;
        /* Float above? Or hide */
        right: 10px;
        display: none !important;
        /* Usually bottom sheets close by dragging or clicking map */
    }

    /* AK: Force Map to be Full Screen underneath the Bottom Sheet */
    #mapId {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        z-index: 1 !important;
        /* Ensure it is below sidenav (15000) */
        flex: none !important;
        /* Disable flex interaction */
    }
}

/* Custom Footer */
.custom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #cccccc;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    z-index: 25000;
    box-sizing: border-box;
    /* Allow map dragging clicks to passthrough empty space on footer, but capture clicks on contents */
    pointer-events: none;
    border-top: 1px solid #aaa;
}

.custom-footer-left,
.custom-footer-center,
.custom-footer-right {
    pointer-events: auto;
}

.custom-footer-left {
    flex: 1;
    color: #333;
}

.custom-footer-left a {
    color: #0056b3;
    text-decoration: none;
}

.custom-footer-left a:hover {
    text-decoration: underline;
}

.custom-footer-center {
    flex: 2;
    text-align: center;
    color: #333;
    padding: 0 15px;
}

.custom-footer-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.custom-footer-logo {
    height: 30px;
    width: auto;
}

.custom-footer-copyright {
    color: #333;
    background: transparent;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

@media only screen and (max-width: 768px) {
    .custom-footer {
        flex-direction: column;
        font-size: 9px;
        padding: 5px;
        text-align: center;
        gap: 5px;
        height: auto !important;
        pointer-events: none !important;
        max-height: 100px;
    }

    .custom-footer-center {
        display: none !important;
    }

    #appHeader {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 15px !important;
        height: 50px !important;
        pointer-events: none !important;
        /* Let clicks pass through empty header space */
    }

    #mobileMenuToggle,
    #appHeader .header-logo,
    #appHeader .header-search-container {
        pointer-events: auto !important;
        /* Re-enable clicks on header items */
    }

    #mobileMenuToggle {
        display: block !important;
    }

    #appHeader .header-logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #appHeader .header-logo img {
        height: 32px !important;
        width: auto !important;
        display: block !important;
    }

    #appHeader .header-title {
        display: none !important;
    }

    #appHeader .header-search-container {
        position: static !important;
        margin-left: auto !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    #appHeader .header-search-container input {
        display: none !important;
    }

    #appHeader .header-search-container span.search-icon {
        position: static !important;
        left: auto !important;
        font-size: 20px !important;
        color: #333 !important;
    }

    #avalanche-button-container {
        display: none !important;
    }

    .avalanche-text {
        display: none !important;
    }

    #userHeaderPanel {
        display: none !important;
    }
}

.custom-footer-logo.mapzs-logo {
    height: 24px !important;
    /* 20% smaller than 30px */
}

.ol-attribution {
    display: none !important;
}

.ol-control.ol-bar.ol-bottom,
.ol-control.ol-zoom,
.ol-scale-line,
.ol-geolocate,
.ol-compass,
.ol-rotate,
.ol-control.ol-location,
.ol-control.position-button,
.ol-control.position-button-wrapper,
.ol-control.location-button,
.ol-control.ol-mycontrol,
.ol-control.ol-full-screen {
    bottom: 105px !important;
}
/* AK: GLOBAL Font Halving for Start/End Points (Desktop + Mobile) */
.point-start-finish, span.point-start-finish, #sidenavContentId .point-start-finish { font-size: 0.5em !important; line-height: 1 !important; }
