body {
    margin: 0;
    font-family: Arial, sans-serif;
}

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

#map {
    flex: 1 1 0%;
    height: 100%;
    min-width: 0;
}

#sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    min-width: 240px;
    width: 270px;
    padding: 16px 10px 16px 10px;
    background: linear-gradient(135deg, #f4f4f4 70%, #e3e9f7 100%);
    border-right: 1.5px solid #e0e0e0;
    box-shadow: 2px 0 12px 0 rgba(60,60,120,0.07);
    overflow-y: auto;
    transition: width 0.2s, min-width 0.2s, max-width 0.2s;
    position: relative;
}
#sidebar h2 {
    font-size: 1.3em;
    font-weight: 700;
    color: #2d3a4a;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    text-align: left;
}

#pin-list {
    list-style: none;
    padding: 0;
}

#pin-list li {
    margin-bottom: 10px;
    padding: 10px;
    background-color: white;
    border: 1px solid #ddd;
    cursor: pointer;
}

#pin-list li:hover {
    background-color: #e0e0e0;
}

.pin-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.pin-coords {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pin-remark {
    color: #333;
    font-size: 1rem;
    margin: 0;
}
.pin-date {
    color: #888;
    font-size: 0.9em;
    margin-top: 2px;
}
.pin-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 10px;
}
.pin-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    color: #444;
    transition: color 0.2s;
    padding: 2px 4px;
}
.pin-action-btn:hover {
    color: #1976d2;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    margin-bottom: 2px;
    margin-top: 2px;
}
.sidebar-header-icon {
    font-size: 1.4em;
    color: #e53935;
    margin-right: 2px;
}
.sidebar-header-title {
    font-size: 1.18em;
    font-weight: 700;
    color: #222b3a;
    letter-spacing: 0.2px;
}
.sidebar-subtext {
    color: #6b7685;
    font-size: 1em;
    margin-bottom: 16px;
    margin-left: 2px;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30,40,60,0.18);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 32px 0 rgba(30,40,60,0.18);
    padding: 32px 28px 24px 28px;
    min-width: 340px;
    max-width: 95vw;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 600;
    color: #222b3a;
    margin-bottom: 8px;
}
.modal-header-icon {
    color: #e53935;
    font-size: 1.3em;
}
.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: #e53935;
}
.modal-label {
    font-weight: 500;
    margin-top: 8px;
    margin-bottom: 2px;
    color: #2d3a4a;
}
.modal-location {
    color: #4b5a6a;
    font-size: 1em;
    margin-bottom: 8px;
}
.modal-textarea {
    width: 100%;
    min-height: 60px;
    border-radius: 8px;
    border: 1.2px solid #d0d7e2;
    padding: 10px;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 10px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.modal-save-btn {
    flex: 1;
    background: #222b3a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.modal-save-btn:hover {
    background: #e53935;
}
.modal-cancel-btn {
    background: #fff;
    color: #222b3a;
    border: 1.2px solid #d0d7e2;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.modal-cancel-btn:hover {
    background: #f4f4f4;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 14px;
    left: -16px;
    background: #fff;
    border: 2.2px solid #b0b8c1;
    border-radius: 60%;
    width: 58px;
    height: 28px;
    font-size: 1.7em;
    color: #1b1a1a;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,40,60,0.13);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.sidebar-toggle-btn:hover {
    background: #e3e9f7;
    color: #111;
    border-color: #222b3a;
}
#sidebar {
    position: relative;
}
#sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
#sidebar.sidebar-expanded {
    display: block;
}
.sidebar-collapsed {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 48px;
    background: #fff;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    box-shadow: -2px 0 12px 0 rgba(60,60,120,0.10);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 2000;
    transition: width 0.2s, background 0.2s;
    border: none;
}
#sidebar-expand.sidebar-toggle-btn {
    position: absolute;
    top: 14px;
    left: unset;
    right: 8px;
    background: #fff;
    border: 2.2px solid #b0b8c1;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.7em;
    color: #111;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,40,60,0.13);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.sidebar-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 60px;
    gap: 10px;
    margin-right: 8px;
}
.sidebar-collapsed-count {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1em;
    color: #2d3a4a;
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Responsive Design: Mobile & Tablet */
@media (max-width: 900px) {
    #container {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
    }
    #sidebar {
        position: relative;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        border-right: none;
        border-bottom: 1.5px solid #e0e0e0;
        box-shadow: 0 2px 12px 0 rgba(60,60,120,0.07);
        padding: 10px 6px 10px 6px;
        z-index: 100;
    }
    #map {
        min-height: 300px;
        height: 60vh;
        width: 100vw;
    }
    .sidebar-collapsed {
        width: 100vw;
        height: 48px;
        border-radius: 0 0 18px 18px;
        top: unset;
        bottom: 0;
        right: 0;
        left: 0;
        flex-direction: row;
        align-items: center;
        box-shadow: 0 -2px 12px 0 rgba(60,60,120,0.10);
    }
    #sidebar-expand.sidebar-toggle-btn {
        left: 8px;
        right: unset;
        top: 8px;
    }
}

@media (max-width: 600px) {
    #container {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
    }
    #sidebar {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        padding: 8px 2px 8px 2px;
        font-size: 0.98em;
    }
    #map {
        min-height: 200px;
        height: 50vh;
        width: 100vw;
    }
    .pin-card {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 0.98em;
    }
    .modal-card {
        min-width: 90vw;
        padding: 18px 8px 14px 8px;
        font-size: 0.98em;
    }
    .modal-header {
        font-size: 1em;
    }
    .modal-textarea {
        font-size: 0.98em;
        min-height: 40px;
    }
    .modal-save-btn, .modal-cancel-btn {
        font-size: 0.98em;
        padding: 8px 0;
    }
    .sidebar-toggle-btn {
        width: 38px;
        height: 24px;
        font-size: 1.2em;
    }
}
