body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
}

#map {
    height: calc(var(--vh, 1vh) * 100);
}

#searchBox {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 50%;
    padding: 8px;
    z-index: 1000;
}

/* #search {
    position: fixed;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    z-index: 1000;
  } */

#locateBtn {
    position: fixed;
    bottom: 20px;
    left: 10px;
    z-index: 1000;
    padding: 10px 15px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
}

/* Modal 外層 */
/* Tiffany Blue 背景遮罩 */
.modal {
    display: none;
    /* 預設隱藏，JS 改為 flex */
    position: fixed;
    z-index: 100005;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    /* 半透明遮罩 */
    animation: fadeIn 0.3s ease-in-out;
    align-items: center;
    justify-content: center;
}

/* Modal 內容區塊 */
.modal-content {
    background-color: #159084;
    /* Tiffany Blue */
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    width: 88%;
    max-width: 400px;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-family: "Segoe UI", sans-serif;
    color: #fff;
    animation: slideUp 0.4s ease;
}

body.modal-open {
    overflow: hidden;
    height: 100%;
}

/* .history-entry {
    background-color: #fff;
    border-left: 4px solid #007bff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 0.3s ease;
    color: #333;
}

.history-entry:hover {
    background-color: #f0f8ff;
} */

#history {
    color: #333;
    margin-top: 1em;
    /* max-height: 200px; */
    overflow-y: auto;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
}

/* 關閉按鈕 */
.close {
    float: right;
    width: 44px;
    height: 44px;
    margin: 18px 4px 8px 8px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #159084;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close:hover {
    background-color: rgba(255, 255, 255, 1);
}

@keyframes slideup {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.modal-content.closing {
  animation: slideup 0.2s ease forwards;
}

/* 下拉選單與按鈕 */
select,
#send {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

select {
    background-color: #ffffff;
    color: #333;
}

#send {
    background-color: #0d6b61;
    color: #ffffff;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#send:hover {
    background-color: #094f48;
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

/* 響應式設計：手機裝置 */
@media (max-width: 600px) {
    .modal-content {
        width: 88%;
        margin: 0;
        padding: 16px;
        border-radius: 10px;
    }

    select,
    button {
        font-size: 14px;
        padding: 10px;
    }
}


#records-btn {
    position: fixed;
    bottom: 46px;
    left: 10px;
    background: #159084;
    border: none;
    padding: 5px 10px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 12px;
    color: white;
    z-index: 1002;
}

#locate-btn {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: #159084;
    border: none;
    padding: 5px 10px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 12px;
    color: white;
    z-index: 1002;
}


.custom-orientation-icon .rotating-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid red;
    transform-origin: center center;
}

.custom-radar-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

.custom-radar-icon .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(30, 144, 255, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.custom-radar-icon .dot {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 14px;
    left: 14px;
    background: dodgerblue;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(30, 144, 255, 0.8);
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

#modal-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 4px;
    flex-wrap: wrap;
}

#modal-cat {
    background: #fff;
    color: #159084;
    font-size: 15px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 12px;
}

#modal-name {
    background: #fff;
    color: #159084;
    font-size: 17px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 12px;
}

#note {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
}


/* 浮動按鈕 */
/* 調整浮動按鈕位置為右上角 */
.floating-buttons {
    position: fixed;
    top: 10px;
    /* 調整為搜尋欄下方的距離 */
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* 按鈕的基本樣式 */
.floating-buttons button {
    position: relative;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, opacity 0.3s;
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-buttons button i {
    position: absolute;
    top: 4px;
    left: 5px;
    font-size: 10px;
    opacity: 0.9;
}

/* 背景顏色 */
.floating-buttons .green {
    background-color: #4CAF50;
}

.floating-buttons .yellow {
    background-color: #FFC107;
}

.floating-buttons .red {
    background-color: #F44336;
}

/* 啟用狀態 */
.floating-buttons button.active {
    opacity: 1;
}

/* 可選：禁用樣式（如果你想防止點擊） */
.floating-buttons button.disabled {
    opacity: 0.2;
    cursor: not-allowed;
}


/* icon 樣式 */
.custom-icon .circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.custom-icon.green .circle {
    background-color: #4CAF50;
}

.custom-icon.yellow .circle {
    background-color: #FFC107;
}

.custom-icon.red .circle {
    background-color: #F44336;
}

/* 按鈕加上徽章容器 */
.toggle-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    text-align: center;
    background-color: #ccc;
    cursor: pointer;
}

.toggle-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #000;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 0 3px rgba(0,0,0,0.4);
}

.floating-buttons .badge {
    position: static;
    background: transparent;
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}











/* 照片區塊 */
#photo-section {
  margin-top: 8px;
}

#photo-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  flex-shrink: 0;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

.photo-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#photo-add-btn {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border: 2px dashed rgba(255,255,255,0.55);
  border-radius: 6px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#photo-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 管理員登入按鈕樣式 */
#openLoginModal {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #2852a7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#openLoginModal:hover {
    background-color: #218838;
}

#openLoginModal i {
    font-size: 16px;
}


.login-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.login-modal-content {
    position: relative;
}



/* 定位等待動畫容器 */
#loading-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    /* background: rgba(255, 255, 255,0.9); */
    padding: 10px 10px;
    border-radius: 12px;
    /* box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2); */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 旋轉的圓形動畫 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    /* margin-bottom: 5px; */
}

/* 提示文字樣式 */
.loading-text {
    font-size: 18px;
    color: #1055aa;
    font-weight: bolder;
}

/* 旋轉動畫效果 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}