/* addpoint.css - 地图添加点位样式文件 */

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* 十字准星线 - 虚线样式 */
.crosshair {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 99;
}

/* 垂直虚线 */
.crosshair::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, #FF6F61 50%, transparent 50%);
    background-size: 100% 4px;
    transform: translateX(-50%);
}

/* 水平虚线 */
.crosshair::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, #FF6F61 50%, transparent 50%);
    background-size: 4px 100%;
    transform: translateY(-50%);
}

#coordinates {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #FF6F61;
    z-index: 1;
    max-width: 240px;
}

/* 登录状态容器 */
.login-status {
    display: none;
}

.user-info {
    color: #666;
}

.login-tip {
    color: #ff4444;
    font-weight: bold;
}

.login-tip a {
    color: #0088ff;
    text-decoration: none;
}

.login-tip a:hover {
    text-decoration: underline;
}

/* 提升父容器层级，独立堆叠上下文 */
.controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 999;
    display: flex;
    gap: 8px;
    flex-direction: column;
    background: white;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
    isolation: isolate;
}

/* 导出菜单向右展开，避开导入按钮 + 提升层级 */
.controls .dropdown:first-of-type .dropdown-content {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 4px;
    z-index: 1005;
}

/* 导入按钮容器 */
.import-btn-container {
    position: relative;
}

/* 导入按钮popup */
.import-popup {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1004;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* 导入按钮hover时显示popup */
.import-btn-container:hover .import-popup {
    opacity: 1;
    pointer-events: auto;
}

/* 文件类型文字颜色 */
.import-popup .file-type {
    color: #0e9a8a;
}

/* 下载链接样式 */
.import-popup .download-link {
    color: #ff6f61;
    text-decoration: none;
}

/* 下载链接hover效果 */
.import-popup .download-link:hover {
    text-decoration: underline;
}

button.control-btn {
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 160px;
}

button.control-btn:hover {
    background: #f8f8f8;
}

button.active-mode {
    background: #e6f7ff;
    border-color: #1890ff;
    font-weight: bold;
}

button.danger {
    background: #d9534f;
    color: white;
    border: none;
}

button.danger:hover {
    background: #d9534f;
    color: white;
    border: none;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    z-index: 1000;
}

.dropdown-toggle {
    position: relative;
    width: 160px;
    z-index: 1001;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    border-radius: 4px;
    margin-top: 0;
    border: 1px solid #eee;
    overflow: hidden;
}

.dropdown-content a {
    color: black;
    padding: 10px 12px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: #f0f7ff;
    color: #1890ff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropdown-toggle {
    background: #f8f8f8;
    border-color: #1890ff;
}

/* Modal 样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px 30px 20px 20px;
    border-radius: 8px;
    width: 340px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.image-preview {
    margin-top: 8px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.form-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-actions .cancel {
    background: #eee;
}

.form-actions .delete {
    background: #dc3545;
    color: white;
}

.form-actions .save {
    background: #007cba;
    color: white;
}

/* 自定义 Marker 图标样式 */
.custom-marker {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-marker img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 页面加载提示弹窗 - 背景虚化+居中+动画 */
.instructions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

/* 遮罩显示状态 */
.instructions-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 浮动提示弹窗主体 */
.floating-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 380px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 14px;
    line-height: 1.8;
}

/* 弹窗显示状态 */
.floating-instructions.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗标题样式 */
.floating-instructions h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
    font-weight: bold;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    color: #FF6F61;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 8px;
}

/* 弹窗正文样式 */
.floating-instructions p {
    margin-bottom: 8px;
    color: #333;
}

.floating-instructions p:last-child {
    margin-bottom: 0;
}

/* 登录信息样式 */
.floating-instructions .login-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.floating-instructions .login-info .user-info {
    margin-bottom: 4px;
}

.floating-instructions .login-info .login-tip {
    color: #ff4444;
    font-weight: bold;
}

.floating-instructions .login-info a {
    color: #0088ff;
    text-decoration: none;
}

.floating-instructions .login-info a:hover {
    text-decoration: underline;
}

/* 弹窗关闭按钮 */
.floating-instructions .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    color: #666;
    transition: background 0.2s ease;
}

/* 关闭按钮hover效果 */
.floating-instructions .close-btn:hover {
    background: #eee;
    color: #FF6F61;
}

.mapboxgl-ctrl-bottom-right div {
    display: none !important;
}
