﻿:root {
    --base-color: white;
    --base-variant: white;
    --selected-color: #003261;
    --red-selected-color: #5e0408;
    --unselected-color: white;
    --text-color: black;
    --secondary-text: grey;
    --primary-color: #333333;
    --accent-color: lightblue;
    --blueBtn-color: #0d6efd;
    --polyline-color: #EA4335;
    --marker-color: #EA4335;
    --warning-color: #EA4335;
    --heli-color: #0d6efd;
    --burger-color: #292929;
    --burger-selected-color: #c7c7c7;
}

.darkmode {
    --base-color: #080808;
    --base-variant: #1a1a1a;
    --selected-color: #071152;
    --red-selected-color: #6b0707;
    --unselected-color: #1a1a1a;
    --text-color: #edf3ff;
    --secondary-text: white;
    --primary-color: #333333;
    --accent-color: #5f6570;
    --polyline-color: #EA4335;
    --warning-color: #EA4335;
    --heli-color: white;
    --burger-color: #bdbdbd;
    --burger-selected-color: #080808;
}

.navbar-toggler {
    border: 2px solid var(--burger-color); 
    background-color: transparent; 
    padding: 0.25rem 0.75rem; 
    border-radius: 0.25rem; 
}

    .navbar-toggler:active,
    .navbar-toggler:focus {
        box-shadow: none;
        background-color: var(--burger-selected-color);
        outline: none;
    }



.navbar {
    background-color: var(--base-variant); 
    border-bottom: 1px solid var(--accent-color);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    margin-bottom: 1rem;
}

    .navbar .nav-link {
        color: var(--text-color);
    }

        .navbar .nav-link:hover {
            color: var(--accent-color);
        }

.navbar .navbar-brand {
    color: var(--text-color);
}
    .navbar .navbar-brand:hover {
        color: var(--accent-color);
    }

/* Increase navbar button size specifically for tablets (iPad width 768–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .navbar .nav-link {
        font-size: 1.4rem; /* bigger text */
        padding: 0.75rem 1.4rem; /* more tap area */
    }

    .navbar .btn,
    .navbar button,
    .navbar .dropdown-toggle {
        font-size: 1.25rem;
        padding: 0.75rem 1.25rem;
    }

    /* Bigger dropdown items */
    .navbar .dropdown-item {
        font-size: 1.2rem;
        padding: 0.75rem 1.25rem;
    }

    /* Increase the brand/logo tap area */
    .navbar-brand svg {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.obstacle-label {
    margin-top: 20px;
}

.formTitle {
    color: var(--text-color)
}

.topTitle {
    color: var(--base-variant)
}

.table > :not(caption) > * > * {
    background-color: var(--base-variant);
    color: var(--text-color)
}

.btn:focus, .btn:active:focus, .btn-link

:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* --------------- Map --------------- */
.leaflet-control-layers {
    font-size: 2vh;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: var(--primary-color);
    background-color: var(--primary-color);
}

/*button switch map for tablet*/
@media (min-aspect-ratio: 10/19) and (max-aspect-ratio: 4/3) {
    .leaflet-control-layers {
        font-size: 1.5vh;
    }

        .leaflet-control-layers label {
            font-size: 1vh;
        }
}

/*button switch map for phone*/
@media (max-aspect-ratio: 10/19) {
    .leaflet-control-layers {
        font-size: 1vh
    }

        .leaflet-control-layers label {
            font-size: 0.5vh;
        }
}

    /* The text next to each checkbox/radio */
    .leaflet-control-layers label {
        color: var(--text-color);
        font-weight: 500;
    }

    
.leaflet-control-layers input[type="checkbox"],
.leaflet-control-layers input[type="radio"] {
        width: 3vh;
        height: 3vh;
    }

/*tablet*/
@media (min-aspect-ratio: 10/19) and (max-aspect-ratio: 4/3) {
    .leaflet-control-layers input[type="radio"],
    .leaflet-control-layers input[type="checkbox"] {
        width: 2.5vh;
        height: 2.5vh;
    }
}

/*phone*/
@media (max-aspect-ratio: 10/19) {
    .leaflet-control-layers input[type="checkbox"],
    .leaflet-control-layers input[type="radio"] {
        width: 2vh;
        height: 2vh;
    }
}

html {
  position: relative;
  min-height: 100%;
}

body {
    margin-bottom: 60px;
    background-color: var(--base-color);
    color: var(--text-color);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Zoom in and out buttons */
.leaflet-control-zoom a.leaflet-control-zoom-in,
.leaflet-control-zoom a.leaflet-control-zoom-out {
        width: 4rem !important;
        height: 4rem !important;
        font-size: 2rem !important;
        line-height: 4rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 0.5rem !important;
        margin: 0px !important; /* spacing between + and - */
        background-color: var(--base-variant) !important;
        color: var(--text-color) !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        cursor: pointer;
    }

/*zoom button for map on tablet*/
@media (min-aspect-ratio: 10/19) and (max-aspect-ratio: 4/3) {
    .leaflet-control-zoom a.leaflet-control-zoom-in,
    .leaflet-control-zoom a.leaflet-control-zoom-out {
        width: 7rem !important; 
        height: 7rem !important;
        font-size: 3.5rem !important;
        line-height: 7rem !important;
    }
}

/*zoom button for map on phone*/
@media (max-aspect-ratio: 10/19) { 
    .leaflet-control-zoom a.leaflet-control-zoom-in,
    .leaflet-control-zoom a.leaflet-control-zoom-out {
        width: 3rem !important; 
        height: 3rem !important;
        font-size: 1.5rem !important;
        line-height: 3rem !important;
    }
}

/*buttons for map*/
.line-btn,
.marker-btn,
.follow-btn {
    width: 4rem !important;
    height: 4rem !important;
}

/*buttons for map on tablet*/
@media (min-aspect-ratio: 10/19) and (max-aspect-ratio: 4/3) {
    .line-btn,
    .marker-btn,
    .follow-btn {
        width: 7rem !important;
        height: 7rem !important;
    }
        .line-btn svg,
        .marker-btn svg,
        .follow-btn svg {
            width: 3.5rem !important;
            height: 3.5rem !important;
        }
}

/*buttons for map on phone*/
@media (max-aspect-ratio: 10/19) {
    .line-btn,
    .marker-btn,
    .follow-btn {
        width: 3rem !important;
        height: 3rem !important;
    }

        .line-btn svg,
        .marker-btn svg,
        .follow-btn svg {
            width: 1.5rem !important;
            height: 1.5rem !important;
        }
}

.leaflet-control-zoom-in {
    margin-bottom: 5px; /* space between + and - */
}

#obstacleBox {
    pointer-events: auto; /* make sure clicks hit the box */
    z-index: 1001; /* slightly above other controls */
}

/* --------------- Buttons on  map --------------- */
/* Floating "Report Obstacle" button */
#obstacleBox {
    position: absolute;
    bottom: 15px; /* distance from bottom */
    left: 50%; /* horizontal center */
    transform: translateX(-50%);
    background: #1976d2;
    color: #fff;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    z-index: 1100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    user-select: none;
    transition: background 0.2s, transform 0.15s;
    width: 98%; /* fixed width for better centering */
    height: 10%;
    text-align: center; /* center text inside button */
    padding: 10px 0;
    font-size: 5vh;
    /* Center text */
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    text-align: center;
}

    #obstacleBox:hover {
        background: #1565c0;
        box-sizing: border-box;
    }
/* Centered coordinate readout (non-blocking) */
.coordinate {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--base-color);
    padding: 6px 10px;
    border-radius: 6px;
    font: 12px/1 system-ui, sans-serif;
    z-index: 1000;
    pointer-events: none;
}

/* --------------- Place bottom --------------- */
.footer {
    background-color: var(--base-variant);
    border-top: thin;
    color: var(--secondary-text)
}

@keyframes greenToRed {
    from {
        background-color: green;
    }

    to {
        background-color: red;
    }
}

/* --------------- Report Form --------------- */
.form-group {
    display: flex;
    align-items: center;
    /*    margin-bottom: 5px;*/
}

    .form-group label {
        width: 50px;
        margin-right: 10px;
/*        margin-left: 10px;*/
        text-align: left;
    }

    .form-group input,
    .form-group textarea,
    .form-group number {
        flex: 1;
        padding: 5px;
    }

        .form-group input[type="checkbox"] {
            flex: 1;
            margin-left: 10px;
            transform: scale(2.5);
            cursor: pointer;
        }

button[name="action"][value="save"] {
    background-color: #ffc107 !important; /* warm yellow */
    color: white !important;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    transition: background-color 0.25s ease;
    margin-top: 2rem;
    width: 20vw;
}

    button[name="action"][value="save"]:hover {
        background-color: #b4bd11 !important;
    }

button[name="action"][value="submit"] {
    background-color: #39b54a !important; /* green */
    color: white !important;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    margin-top: 2rem;
    width: 20vw;
}

    button[name="action"][value="submit"]:hover {
        background-color: #2a8737 !important;
    }

.btnSubmit {
    background-color: #198754;
    border: none;
    color: ghostwhite;
    padding: 15px 30px;
    text-align: left;
    display: inline-block;
    border-radius: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btnSimple {
    background-color: #198754;
    border: none;
    color: ghostwhite;
    padding: 15px 30px;
    text-align: left;
    display: inline-block;
    border-radius: 6px;
}
.btnSimple:hover {
    background-color: darkgreen;
}


.btnBack {
    background-color: lightgrey;
    border: none;
    color: black;
    padding: 15px 30px;
    text-align: left;
    display: inline-block;
    border-radius: 6px;
}
.btnBack:hover {
    background-color: darkgrey;
}

/* --- DARK MODE BUTTON --- */
#theme-switch {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#theme-switch:hover {
    transform: scale(1.15);
}

#theme-switch svg {
    fill: var(--text-color) !important;
    width: 22px;
    height: 22px;
}

.darkmode #theme-switch svg:last-child {
    display: inline;
}

#theme-switch svg{
    fill: var(--primary-color);
}

#theme-switch svg:last-child{
    display: none;
}

.darkmode #theme-switch svg:first-child{
    display: none;
}

.darkmode #theme-switch svg:last-child{
    display: block;
}

#map {
    position: relative;

}

/* Dark basemap without a tile-provider API key: invert OSM tiles */
.leaflet-layer.map-tiles-dark {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Make sure to give right color on user-/loginmenu in darkmode*/
.navbar .nav-link,
.navbar .dropdown-toggle {
    color: var(--text-color) !important;
}

.navbar .nav-link:hover,
.navbar .dropdown-toggle:hover {
    color: var(--accent-color) !important;
}

/* Force yellow hamburger icon */
.navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='var(--accent-color)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    filter: none !important; /* remove default Bootstrap filter */
    background-color: transparent; /* prevent grey background */
}

/* --------------- Dropdown for users/login top right corner --------------- */
.dropdown-menu {
    z-index: 2000 !important; /* To give the dropdown menu priority over other elements of the view, sign in element will stay on top*/
    background-color: var(--base-variant); /* white background */
    opacity: 1 !important; /* fully non-transparent*/
    backdrop-filter: none !important; /* Removes glass-effect */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* optional, shadow for depth*/
}

.dropdown-menu .dropdown-item {
    color: var(--text-color);
    background-color: var(--base-variant);
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--accent-color);
    color: var(--base-color);
}

/* --------------- Create Report Pop Up --------------- */

/* ===== Obstacle option cards ===== */
.obstacle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 per row */
    gap: 12px; /* space between squares */
}

.obstacle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 10rem; /* make them big */
    border-radius: 16px; /* rounded rectangle */
    border: 2px solid var(--accent-color);
    background: var(--base-variant);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
    text-align: center;
}

    .obstacle-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.12);
    }

    .obstacle-card img,
    .obstacle-card .obstacle-emoji {
        width: 48px;
        height: 48px;
        display: inline-block;
        line-height: 48px;
        font-size: 36px; /* for emoji fallback */
    }

    .obstacle-card span {
        font-weight: 600;
        font-size: 1.05rem;
    }

/* Checked state (paired with .btn-check radio) */
.btn-check:checked + .obstacle-card {
    background: var(--blueBtn-color); /* Bootstrap primary */
    border-color: var(--blueBtn-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(13,110,253,.35);
}

/* Keyboard focus when tabbing to the radio */
.btn-check:focus + .obstacle-card {
    outline: 3px solid rgba(13,110,253,.4);
    outline-offset: 2px;
}

/* Dark mode tweaks */
.darkmode .obstacle-card {
    border-color: #424242;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.darkmode .btn-check:checked + .obstacle-card {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

/* ---------- Height + Light row ----------*/
.height-light-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Hide the radios */
.unit-switch input[type="radio"] {
    display: none;
}

/* Outer container */
.unit-switch {
    display: flex;
    width: 100%; /* fill the container like your buttons */
    max-width: 220px; /* optional: same max as buttons */
    height: 42px;
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    overflow: hidden;
    background: var(--base-variant);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: all 0.15s ease;
}

    /* Labels fill exactly 50% each */
    .unit-switch label.switch-option {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        cursor: pointer;
        color: var(--text-color);
        background: transparent;
        transition: all 0.2s ease;
        user-select: none;
    }


        /* Hover glow */
        .unit-switch label.switch-option:hover {
            background: rgba(13,110,253,0.08);
        }

/* Checked states (fills exactly half the box) */
#unitMeters:checked + label.switch-option {
    background: var(--blueBtn-color);
    color: #fff;
    border-right: 1px solid var(--blueBtn-color);
}

#unitFeet:checked + label.switch-option {
    background: var(--blueBtn-color);
    color: #fff;
    border-left: 1px solid var(--blueBtn-color);
}

/* Remove invisible middle border gap */
.unit-switch label.switch-option:first-of-type,
.unit-switch label.switch-option:last-of-type {
    margin: 0;
}

/* Smooth focus effect */
.unit-switch input[type="radio"]:focus + label.switch-option {
    outline: 3px solid rgba(13,110,253,.4);
    outline-offset: 2px;
}

/* Dark mode adjustments */
.darkmode .unit-switch {
    border-color: #424242;
    background: var(--base-variant);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.darkmode #unitMeters:checked + label.switch-option,
.darkmode #unitFeet:checked + label.switch-option {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

/* Lighted box (samme stil som obstacle-card) */
.light-card-small {
    width: 120px;
    height: 85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    gap: 6px;
    margin-left: auto;
    background: var(--base-variant);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

/* Hide "On"-icon as standard*/
.icon-on {
    display: none;
}

/* When checkbox are pressed (checked), switch icon*/
.btn-check:checked + .light-card-small .icon-off {
    display: none;
}

.btn-check:checked + .light-card-small .icon-on {
    display: inline-block;
}

.light-icon svg {
    width: 36px;
    height: 36px;
    transition: fill 0.2s ease, filter 0.2s ease;
}

/* when active: glow-effect on "ON"-icon*/
.btn-check:checked + .light-card-small .icon-on svg {
    filter: drop-shadow(0 0 6px #ffeb3b);
}

/* Hover-effect */
.light-card-small:hover svg {
    filter: drop-shadow(0 0 4px var(--accent-color));
}

    /* Hover-effect (same as obstacle-card) */
    .light-card-small:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.12);
    }

/* Checked state */
.btn-check:checked + .light-card-small {
    background: var(--blueBtn-color) ;
    border-color: var(--blueBtn-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(13,110,253,.35);
}

    /* glowing icon when active*/
    .btn-check:checked + .light-card-small .obstacle-emoji svg {
        fill: #ffeb3b;
        filter: drop-shadow(0 0 6px #ffea00);
    }

/* Dark mode adjustments */
.darkmode .light-card-small {
    border-color: #424242;
    background: var(--base-variant);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.darkmode .btn-check:checked + .light-card-small {
    background: #0b5ed7;
    border-color: #0b5ed7;
    color: #fff;
}


/* Match switch height */
.unit-switch {
    height: 85px;
    border-radius: 12px;
}

    .unit-switch label.switch-option {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }

/* Match input height and padding */
#heightInput {
    height: 85px;
    width: 30%;
    border-radius: 12px;
    font-size: 1rem;
    padding: 0px;
    box-sizing: border-box;
}

/* --- Responsive fallback for smaller screens --- */
@media (max-width: 768px) {
    .height-light-row {
        flex-direction: row;
        align-items: stretch;
    }

    .light-card-small,
    #heightInput,
    .unit-switch {
        height: 70px;
    }
}

/* Center the dialog on screen (safe cross-browser) */
dialog#reportDialog {
    padding: 0;
    border: none;
    width: 80vw;
    height: 90vh;
    max-width: 900px;
    max-height: 1000px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
}

dialog::backdrop {
    background: rgba(0,0,0,.35);
}

.dialog-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--base-variant);
    border-radius: 10px;
    overflow: hidden;
}

/* Header: 3 columns → center ADD REPORT title perfectly */
.dialog-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left spacer | title | right (close) */
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
}

    .dialog-header .formTitle {
        grid-column: 2; /* center column */
        justify-self: center;
        font-weight: 700;
    }

#reportClose {
    grid-column: 3; /* right column */
    justify-self: end;
}

/* Make the iframe fill the remaining space */
#reportFrame {
    flex: 1;
    border: 0;
    width: 100%;
}

/*Submit and Draft button*/
/* Whatever wraps the buttons (e.g., the dialog body or form) */
/* remove the global absolute positioning on .btn ! */
.report-form, .dialog-body, form {
    position: static;

}

/* layout the row */
.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

    /* size each button */
    .form-group .btn {
        height: 130px;
        min-width: 150px;
        font-size: 1.15rem;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-weight: 600;
    }

    /*---------------------------------Submit and Draft button-------------------*/
/* --- common styling for both buttons--- */
button[name="action"][value="save"],
button[name="action"][value="submit"] {
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* --- Light Mode --- */
body:not(.darkmode) button[name="action"][value="save"] {
    background-color: #f0c93d; /* warm yellow*/
    color: #000; /* black text */
}

    body:not(.darkmode) button[name="action"][value="save"]:hover {
        background-color: #e0b830;
    }

body:not(.darkmode) button[name="action"][value="submit"] {
    background-color: #198754; /* green */
    color: #000; /* black text */
}

    body:not(.darkmode) button[name="action"][value="submit"]:hover {
        background-color: #157347;
    }

/* --- Dark Mode --- */
body.darkmode button[name="action"][value="save"] {
    background-color: #c7a525; /* darker yellow */
    color: #fff; /* white text*/
}

    body.darkmode button[name="action"][value="save"]:hover {
        background-color: #b69520;
    }

body.darkmode button[name="action"][value="submit"] {
    background-color: #157347; /* darker green*/
    color: #fff; /* white text */
}

    body.darkmode button[name="action"][value="submit"]:hover {
        background-color: #116d3f;
    }

    /* Changes to the CreatePopup report page */
/* Light mode: add a subtle black border to 'Details' and the Height input */
body:not(.darkmode) #heightInput,
body:not(.darkmode) textarea[name="NewReport.Details"] {
    border: 1px solid #000; /* small black border */
    box-shadow: none; /* optional: remove Bootstrap inset glow */
}

    /* Keep the same border when focused (while leaving your global focus ring) */
    body:not(.darkmode) #heightInput:focus,
    body:not(.darkmode) textarea[name="NewReport.Details"]:focus {
        border-color: #000;
    }



