/*
=========================================
FIX-PIN
style.css
=========================================
*/


/* =====================================
RESET
===================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =====================================
COLORS
===================================== */

:root {

    --primary: #4285f4;
    --primary-hover: #2f6fe0;

    --pin: #4285f4;
    --pin-hover: #2f6fe0;

    --save: #34a853;
    --save-hover: #278642;

    --go-to: #f9ab00;
    --go-to-hover: #dd9300;

    --danger: #d93025;
    --danger-soft: #fce8e6;

    --surface: #ffffff;
    --surface-soft: #f5f7fb;

    --background: #eef2f7;

    --text: #202124;
    --text-secondary: #5f6368;

    --outline: #d0d7e2;

    --overlay:
        rgba(32, 33, 36, 0.42);

    --shadow:
        0 2px 6px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.05);

    --menu-shadow:
        0 8px 20px rgba(0, 0, 0, 0.14),
        0 20px 50px rgba(0, 0, 0, 0.12);

    --radius: 16px;

}


/* =====================================
BODY
===================================== */

body {

    min-height: 100vh;

    background: var(--background);

    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

}


/*
Запрещает прокрутку страницы,
когда открыто меню.
*/

body.menu-open {

    overflow: hidden;

}


/* =====================================
APP
===================================== */

.app-container {

    width: 100%;

    max-width: 700px;

    margin: 0 auto;

    padding: 12px;

}


/* =====================================
HEADER
===================================== */

.app-header {

    min-height: 46px;

    margin-bottom: 10px;

    padding: 0 4px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}


.app-title {

    color: var(--text);

    font-size: 21px;

    font-weight: 700;

    line-height: 1;

}


/* =====================================
MENU BUTTON
===================================== */

.menu-button {

    flex: 0 0 42px;

    width: 42px;

    height: 42px;

    padding: 0;

    border: none;

    border-radius: 12px;

    background: var(--surface);

    color: var(--text);

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.08);

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background-color 0.2s,
        color 0.2s,
        transform 0.1s;

}


.menu-button:hover {

    background: #e8f0fe;

    color: var(--primary);

}


.menu-button:active {

    transform: scale(0.96);

}


.menu-button i {

    font-size: 24px;

}


/* =====================================
MENU OVERLAY
===================================== */

.menu-overlay {

    position: fixed;

    inset: 0;

    z-index: 1000;

    background: var(--overlay);

    animation:
        overlay-fade-in 0.2s ease-out;

}


.menu-overlay[hidden] {

    display: none;

}


/* =====================================
APP MENU
===================================== */

.app-menu {

    position: fixed;

    top: 12px;

    right: 12px;

    z-index: 1001;

    width: min(300px, calc(100vw - 24px));

    padding: 12px;

    border: 1px solid var(--outline);

    border-radius: 18px;

    background: var(--surface);

    box-shadow: var(--menu-shadow);

    animation:
        menu-slide-in 0.2s ease-out;

}


.app-menu[hidden] {

    display: none;

}


/* =====================================
MENU HEADER
===================================== */

.menu-header {

    min-height: 42px;

    margin-bottom: 6px;

    padding: 0 4px 8px;

    border-bottom: 1px solid var(--outline);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

}


.menu-header strong {

    font-size: 17px;

    font-weight: 700;

}


/* =====================================
MENU CLOSE BUTTON
===================================== */

.menu-close-button {

    flex: 0 0 36px;

    width: 36px;

    height: 36px;

    padding: 0;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background-color 0.2s,
        color 0.2s;

}


.menu-close-button:hover {

    background: var(--surface-soft);

    color: var(--text);

}


.menu-close-button i {

    font-size: 21px;

}


/* =====================================
MENU ITEMS
===================================== */

.menu-item {

    width: 100%;

    min-height: 48px;

    margin-top: 4px;

    padding: 0 14px;

    border: none;

    border-radius: 12px;

    background: transparent;

    color: var(--text);

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: flex-start;

    gap: 12px;

    font-size: 15px;

    font-weight: 600;

    text-align: left;

    transition:
        background-color 0.2s,
        color 0.2s;

}


.menu-item:hover {

    background: #e8f0fe;

    color: var(--primary);

}


.menu-item:active {

    background: #dce8fc;

}


.menu-item i {

    flex-shrink: 0;

    width: 22px;

    font-size: 21px;

    text-align: center;

}


/*
Тонкий разделитель перед About.
*/

#aboutBtn {

    margin-top: 10px;

    position: relative;

}


#aboutBtn::before {

    content: "";

    position: absolute;

    top: -6px;

    left: 8px;

    right: 8px;

    height: 1px;

    background: var(--outline);

}


/* =====================================
MAP
===================================== */

#map {

    width: 100%;

    height: 31vh;

    min-height: 190px;

    max-height: 270px;

    margin-bottom: 10px;

    overflow: hidden;

    border-radius: var(--radius);

    box-shadow: var(--shadow);

}


/* =====================================
INPUTS
===================================== */

input {

    width: 100%;

    height: 42px;

    margin-bottom: 10px;

    padding: 0 14px;

    border: 1px solid var(--outline);

    border-radius: 12px;

    background: var(--surface);

    color: var(--text);

    font-size: 15px;

    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;

}


input:focus {

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(66, 133, 244, 0.14);

}


input::placeholder {

    color: var(--text-secondary);

}


/* =====================================
MAIN BUTTONS
===================================== */

.actions {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;

    margin-bottom: 10px;

}


.actions button {

    min-width: 0;

    height: 42px;

    padding: 0 10px;

    border: none;

    border-radius: 11px;

    color: #ffffff;

    cursor: pointer;

    font-size: 13px;

    font-weight: 600;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    white-space: nowrap;

    overflow: hidden;

    transition:
        background-color 0.2s,
        transform 0.1s,
        opacity 0.2s;

}


.actions button:hover {

    transform: translateY(-1px);

}


.actions button:active {

    transform: translateY(0);

}


.actions button:disabled {

    cursor: default;

    opacity: 0.55;

    transform: none;

}


.actions button i {

    flex-shrink: 0;

    font-size: 18px;

}


/* PIN */

#alertBtn {

    background: var(--pin);

}


#alertBtn:hover {

    background: var(--pin-hover);

}


/* SAVE */

#myButton {

    background: var(--save);

}


#myButton:hover {

    background: var(--save-hover);

}


/* GO TO */

#goToSelectedBtn {

    background: var(--go-to);

}


#goToSelectedBtn:hover {

    background: var(--go-to-hover);

}


/* =====================================
SEARCH
===================================== */

#searchInput {

    margin-bottom: 10px;

}


/* =====================================
LIST
===================================== */

#data-list {

    list-style: none;

    display: flex;

    flex-direction: column;

    gap: 7px;

}


/*
Каждая точка занимает одну строку:

Point 1                         Show   Delete
*/

#data-list li {

    min-height: 50px;

    padding: 6px 8px 6px 14px;

    background: var(--surface);

    border: 1px solid var(--outline);

    border-radius: 13px;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.06);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

}


/*
Поддержка существующего контейнера .row,
который создаётся в JavaScript.
*/

#data-list .row {

    width: 100%;

    min-width: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

}


/* Название точки */

.note {

    min-width: 0;

    flex: 1;

    margin: 0;

    overflow: hidden;

    color: var(--text);

    font-size: 15px;

    font-weight: 600;

    line-height: 1.25;

    text-overflow: ellipsis;

    white-space: nowrap;

}


/* Дату и время больше не показываем */

.time {

    display: none;

}


/*
Контейнер кнопок карточки.
Поддерживаются разные возможные названия класса.
*/

.point-actions,
.item-actions,
.row-actions,
.list-actions {

    flex-shrink: 0;

    display: flex;

    align-items: center;

    gap: 4px;

}


/* Кнопки внутри карточки */

.icon-btn {

    flex: 0 0 36px;

    width: 36px;

    height: 36px;

    padding: 0;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background-color 0.2s,
        color 0.2s;

}


.icon-btn:hover {

    background: #e8f0fe;

    color: var(--primary);

}


.icon-btn i {

    font-size: 20px;

}


/* Активная точка, уже показанная на карте */

.icon-btn.active,
.icon-btn.is-visible,
.show-map-btn.active {

    background: #e8f0fe;

    color: var(--primary);

}


/* Кнопка удаления */

.delete-btn {

    color: var(--danger);

}


.delete-btn:hover {

    background: var(--danger-soft);

    color: var(--danger);

}


/* =====================================
ABOUT DIALOG
===================================== */

.about-dialog {

    width: min(440px, calc(100vw - 24px));

    max-height: calc(100vh - 24px);

    margin: auto;

    padding: 0;

    overflow: hidden;

    border: 1px solid var(--outline);

    border-radius: 18px;

    background: var(--surface);

    color: var(--text);

    box-shadow: var(--menu-shadow);

}


.about-dialog[open] {

    animation:
        dialog-show 0.2s ease-out;

}


.about-dialog::backdrop {

    background: var(--overlay);

    animation:
        overlay-fade-in 0.2s ease-out;

}


/* =====================================
ABOUT CONTENT
===================================== */

.about-content {

    padding: 18px;

}


.about-header {

    margin-bottom: 16px;

    padding-bottom: 12px;

    border-bottom: 1px solid var(--outline);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}


.about-header h2 {

    font-size: 20px;

    font-weight: 700;

    line-height: 1.2;

}


/* =====================================
ABOUT CLOSE BUTTON
===================================== */

.about-close-button {

    flex: 0 0 38px;

    width: 38px;

    height: 38px;

    padding: 0;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background-color 0.2s,
        color 0.2s;

}


.about-close-button:hover {

    background: var(--surface-soft);

    color: var(--text);

}


.about-close-button i {

    font-size: 21px;

}


/* =====================================
ABOUT TEXT
===================================== */

.about-content p {

    margin-bottom: 12px;

    color: var(--text-secondary);

    font-size: 15px;

    line-height: 1.55;

}


.about-content p:last-child {

    margin-bottom: 0;

}


.about-version {

    padding-top: 4px;

    color: var(--primary) !important;

    font-size: 14px !important;

    font-weight: 700;

}


/* =====================================
LEAFLET POPUP
===================================== */

.leaflet-popup-content {

    margin: 10px 14px;

    color: var(--text);

    font-size: 14px;

    font-weight: 600;

}


/* =====================================
ANIMATIONS
===================================== */

@keyframes overlay-fade-in {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }

}


@keyframes menu-slide-in {

    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


@keyframes dialog-show {

    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =====================================
PHONE
===================================== */

@media (max-width: 600px) {

    .app-container {

        padding: 8px;

    }


    .app-header {

        min-height: 42px;

        margin-bottom: 8px;

        padding: 0 2px;

    }


    .app-title {

        font-size: 20px;

    }


    .menu-button {

        flex-basis: 40px;

        width: 40px;

        height: 40px;

        border-radius: 11px;

    }


    .menu-button i {

        font-size: 23px;

    }


    .app-menu {

        top: 8px;

        right: 8px;

        width: min(290px, calc(100vw - 16px));

    }


    #map {

        height: 29vh;

        min-height: 175px;

        margin-bottom: 8px;

        border-radius: 14px;

    }


    input {

        height: 40px;

        margin-bottom: 8px;

    }


    .actions {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 6px;

        margin-bottom: 8px;

    }


    .actions button {

        height: 40px;

        padding: 0 7px;

        border-radius: 9px;

        font-size: 12px;

        gap: 4px;

    }


    .actions button i {

        font-size: 17px;

    }


    #data-list {

        gap: 6px;

    }


    #data-list li {

        min-height: 48px;

        padding:
            5px
            6px
            5px
            12px;

    }


    .note {

        font-size: 14px;

    }


    .icon-btn {

        flex-basis: 34px;

        width: 34px;

        height: 34px;

    }


    .icon-btn i {

        font-size: 19px;

    }


    .about-content {

        padding: 16px;

    }

}


/* =====================================
VERY SMALL PHONE
===================================== */

@media (max-width: 360px) {

    .actions button span {

        display: none;

    }


    .actions button {

        padding: 0;

    }


    .actions button i {

        font-size: 20px;

    }


    .app-title {

        font-size: 19px;

    }

}
/* =====================================
TOAST
===================================== */

.toast {

    position: fixed;

    left: 50%;
    bottom: 30px;

    transform:
        translateX(-50%)
        translateY(20px);

    padding:
        12px 22px;

    background: #34a853;

    color: #ffffff;

    border-radius: 12px;

    font-size: 15px;

    font-weight: 600;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .25s,
        transform .25s,
        visibility .25s;

    z-index: 9999;

    box-shadow:
        0 8px 24px
        rgba(0,0,0,.25);

}

.toast.show {

    opacity: 1;

    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);

}

/* =====================================
REDUCED MOTION
===================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

    }

}
