﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body, html {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
}

#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

#sidebar {
    width: 380px;
    background: #f7fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    overflow-y: auto;
    flex-direction: column;
    z-index: 10;
    height: 100%;
    padding-bottom: 100px;
}

#map {
    flex-grow: 1;
    height: 100%;
    background-color: #edf2f7;
}

/* Sticky Header Customization Style Framework */
.sticky-expedition-header {
    background: #1a202c;
    color: white;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    shrink: 0;
}

    .sticky-expedition-header h2 {
        font-size: 1.05rem;
        margin-bottom: 2px;
    }

    .sticky-expedition-header p {
        font-size: 0.85rem;
        color: #a0aec0;
        font-weight: 500;
    }

/* Foldable Accordion Framework Core Components */
.accordion-section {
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.accordion-toggle {
    width: 100%;
    background: #edf2f7;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: bold;
    color: #4a5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    cursor: pointer;
}

    .accordion-toggle:hover {
        background: #e2e8f0;
    }

.accordion-content {
    padding: 15px;
    display: none;
    background: white;
}

.accordion-section.open .accordion-content {
    display: block;
}

.accordion-section.open .toggle-icon::before {
    content: "▼";
}

.toggle-icon::before {
    content: "▶";
    font-size: 0.75rem;
}

/* Operational Input Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
}

button {
    background: #3182ce;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

    button:hover {
        background: #2b6cb0;
    }

.form-panel-box {
    background: #ebf8ff;
    border: 2px solid #63b3ed;
    padding: 12px;
    border-radius: 8px;
    margin: 10px;
}

.challenge-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.challenge-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

    .challenge-header-row input[type="checkbox"] {
        width: auto;
        height: auto;
        margin: 0;
        cursor: pointer;
    }

.progress-bar-container {
    background: #edf2f7;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-bar {
    background: #48bb78;
    height: 100%;
    width: 0%;
}

.poi-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: 4px 0;
    border-bottom: 1px dashed #edf2f7;
}

    .poi-list-item.visited span {
        text-decoration: line-through;
        color: #a0aec0;
    }

.visit-btn {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: #48bb78;
}

    .visit-btn.done {
        background: #718096;
    }

.node-card {
    border-left: 2px solid #e53e3e;
    padding-left: 8px;
    margin: 6px 0;
}

.node-time {
    font-size: 0.65rem;
    color: #a0aec0;
    display: block;
}

.node-img {
    width: 100%;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* Dashboard Modal Screen Overlay Style Profile */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26,32,44,0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.dashboard-content {
    background: white;
    width: 100%;
    height: 95vh;
    border-radius: 2%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.dashboard-grid {
    flex-grow: 1;
    overflow: scroll;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-top: 15px;
    padding-bottom: 150px;
}

.dash-node-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 1. Base button styles (Hidden on Desktop by default) */
#sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2000; /* High z-index sits perfectly on top of the Leaflet Map layer */
    background: #3182ce;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.2s;
}

/* 2. Responsive Mobile Layout Overrides */
@media (max-width: 768px) {
    #sidebar-toggle-btn {
        display: block; /* Reveals the trigger toggle on mobile viewports */
    }

    #app-container {
        position: relative;
        overflow: hidden;
    }

    #map {
        width: 100% !important;
        height: 100vh !important;
    }

    #sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 310px;
        max-width: 85%; /* Ensures a small margin of map stays exposed on tiny screens */
        height: 100vh;
        background: white;
        z-index: 1999; /* Positions below the menu button, but above the map canvas */
        box-shadow: -4px 0 15px rgba(0,0,0,0.2);
        padding: 60px 15px 15px 15px; /* Added extra top padding so elements don't clip under button */
        /* Smooth Slide Panel Physics */
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        padding-bottom: 150px;
    }

        /* Active state class injected dynamically via Javascript */
        #sidebar.mobile-open {
            transform: translateX(0);
        }
}

.dash-img-large {
    width: 100%;
    object-fit: cover;
    border-radius: 6px;
    margin-top: auto;
}

.status-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    background: #48bb78;
}

.restart-btn {
    background: #4a5568;
    font-size: 0.65rem;
    padding: 2px 6px;
}

.open-dash-btn {
    background: #3182ce;
    font-size: 0.65rem;
    padding: 2px 6px;
}

#bottom-btn {
    position: fixed;
    bottom: 20px;
    width: 86%;
    left: 7%;
    display: block;
    z-index: 2000; /* High z-index sits perfectly on top of the Leaflet Map layer */
    background: #FF0000;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.2s;
    visibility: hidden;
}
