@import "https://unpkg.com/open-props";

:root {
    --color-primary: var(--teal-12);
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-humanist);
    overflow: hidden;
    background-color: #f0f0f0;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

select {
    /* background-color: #fff; */
    border-radius: 8px;
    padding: 4px 8px 4px 8px;
    /* font-size: 16px; */
}

.app-header {
    background-color: #000;
    background-image: var(--gradient-8), var(--noise-3);
    filter: var(--noise-filter-3);
    background-size: cover;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    box-sizing: border-box;
}

.app-header h1 {
    margin: 0;
    font-size: 1.5em;
}

.app-header nav a {
    color: #aedff7;
    text-decoration: none;
    margin-left: 15px;
}

.app-header nav a:hover {
    text-decoration: underline;
}

.app-main {
    display: flex;
    height: calc(100vh - 50px);
}

/* Control Section Styling */
.controls-sidebar {
    position: relative;
    width: 300px;
    background-color: #f8f8f8;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: width 0.3s ease, padding 0.3s ease, border 0.3s ease;
    flex-shrink: 0;
}

.controls-sidebar label {
    display: block;
    margin-top: 10px;
    margin-bottom: 3px;
    font-size: 0.9em;
    color: #666;
}

.controls-sidebar input[type="number"] {
    width: calc(100% - 22px);
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.controls-sidebar h2 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    color: #333;
}

.controls-sidebar h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
    color: #555;
}

.control-section {
    margin-bottom: 15px;
}

.controls-sidebar input[type="text"] {
    width: calc(100% - 22px);
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.controls-sidebar button {
    padding: 8px 15px;
    /* background-color: #5c8dce; */
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#filter-button {
    margin-block-start: 8px;
}

.controls-sidebar button:hover {
    background-color: #4a7bbc;
}

.sidebar-content {
    transition: opacity 0.2s ease;
    opacity: 1;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#sidebar-toggle-button {
    position: absolute;
    top: 10px;
    right: -15px;
    z-index: 10;
    width: 30px;
    height: 30px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    padding: 0;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, right 0.3s ease;
}

#sidebar-toggle-button:hover {
    background-color: #4a7bbc;
}

/* sidebar collapsed state */
.controls-sidebar.sidebar-collapsed {
    width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
}

.controls-sidebar.sidebar-collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.controls-sidebar.sidebar-collapsed #sidebar-toggle-button {
    right: -15px;
}

.status-message {
    font-size: 0.9em;
    margin-top: 8px;
    min-height: 1.2em;
}

#category-filters label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

#category-filters input[type="checkbox"] {
    margin-right: 8px;
}

.map-container {
    flex-grow: 1;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
}

.leaflet-popup-content-wrapper {
    border-radius: 5px;
}

.popup-image {
    max-width: 150px;
    max-height: 100px;
    margin-top: 5px;
    border-radius: 4px;
    /* object-fit: cover; */
}

.popup-status {
    display: inline-block;
    background-color: red;
    padding-inline: 8px;
    padding-block: 2px;
    border-radius: 100vmax;

}

/* 
 'submitted',
    'in_progress',
    'resolved',
    'invalid'
 */
.popup-status[data-status="submitted"] {
    background-color: var(--gray-5);
}

.popup-status[data-status="in_progress"] {
    background-color: var(--yellow-3);
}

.popup-status[data-status="resolved"] {
    background-color: var(--color-primary);
    color: #fff;
}

.popup-status[data-status="invalid"] {
    background-color: var(--red-9);
    color: #fff;
}

#search-status.loading,
#filter-status-message.loading {
    color: #888;
}

#search-status.error,
#filter-status-message.error {
    color: #d9534f;

}

#search-status.success,
#filter-status-message.success {
    color: #5cb85c;

}