/* Remove the default margin and padding from the body and html elements */

@font-face {
    font-family: "GitLab Mono";
    src: url("/fonts/GitLabMono.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "GitLab Sans";
    src: url("/fonts/GitLabSans.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Prevent scrolling */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.log-entry {
    animation: fadeIn 0.3s ease-in;
}

#grid {
    display: grid;
    grid-template-rows: 1fr auto 20%;
    height: 100vh;
    margin: 0;
    padding: 0;
}

#map {
    background-color: #f5f5f5;
    overflow: hidden;
}

#handle {
    padding: 5px 0;
    background-color: #ddd;
    cursor: row-resize;
    text-align: center;
    user-select: none;
    position: relative;
}

#handle:hover {
    background-color: #ccc;
}

#handle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 4px;
    background: #999;
    border-radius: 2px;
}

/* The tab bar and whichever pane is showing beneath it */
#panel {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
    background-color: #f0f0f0;
}

#tabs {
    display: flex;
    gap: 2px;
    padding: 4px 4px 0;
    background-color: #ddd;
}

.tab {
    padding: 6px 16px;
    border: none;
    border-radius: 4px 4px 0 0;
    background-color: #ccc;
    color: #333;
    font-family: GitLab Sans, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.tab:hover {
    background-color: #c4c4c4;
}

.tab.active {
    background-color: #f0f0f0;
    color: #000;
}

.pane {
    overflow: auto;
    padding: 10px;
    min-height: 0;
}

.pane[hidden] {
    display: none;
}

#log {
    font-family: GitLab Mono, monospace;
    color: #000;
}

#stats {
    font-family: GitLab Sans, sans-serif;
    font-size: 0.9rem;
    color: #000;
}

#stats .summary {
    margin-bottom: 10px;
    color: #666;
}

/* One card per category, wrapping to fit whatever width the panel has */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
    gap: 10px;
}

.card {
    padding: 10px;
    border-radius: 4px;
    background-color: #fff;
}

.card h2 {
    margin: 0 0 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 1px 0;
}

.row .label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: GitLab Mono, monospace;
}

.row .value {
    color: #666;
}

/* Attempts per hour, as plain divs rather than a charting library */
.bar-row {
    display: grid;
    grid-template-columns: 3.5em 1fr 3em;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
    font-family: GitLab Mono, monospace;
}

.bar {
    height: 10px;
    border-radius: 2px;
    background-color: #c33;
}

/* Add media query for mobile devices */
@media (pointer: coarse) and (hover: none) {
    #handle {
        min-height: 24px;
    }

    /* Increase the font size within the log and stats */
    #log,
    #stats,
    .tab {
        font-size: 1.75rem;
    }

    /* Increase the font size and padding within the popup */
    .leaflet-popup-content-wrapper {
        font-size: 1.75rem;
        padding: 10px 15px;
    }
    /* Increase the maximum width of the popup */
    .leaflet-popup {
        max-width: 400px;
    }
}
