/* 组件样式 public/css/components.css(121901) */

/* 底部导航按钮激活状态 */
.nav-btn.active {
    color: #4CAF50 !important;
    font-weight: 600;
}

.nav-btn.active .btn-icon {
    transform: scale(1.1);
}

/* 菜单按钮悬停效果 */
.menu-btn:not(.disabled):hover {
    background: #e9ecef;
}

.menu-btn.primary:not(.disabled):hover {
    background: #45a049;
}

/* 关闭按钮动画 */
.close-btn {
    transition: transform 0.3s ease;
}

.close-btn:active {
    transform: rotate(180deg);
}

/* 地图容器样式 */
.map-container {
    background: #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-btn {
        min-height: 44px;
        min-width: 60px;
    }
    
    .menu-btn {
        min-height: 44px;
    }
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 错误状态 */
.error {
    color: #f44336;
    background: #ffebee;
    border: 1px solid #f44336;
}

/* 弹窗层级修复 */
.modal, .management-modal {
    z-index: 4000 !important;
}

.modal .modal-content, 
.management-modal .modal-content {
    z-index: 4001 !important;
}

/* 子弹窗确保在最上层 */
#text-input-modal,
#icon-selector-modal,
#image-picker-modal,
#group-selection-modal,
#image-management-modal,
#image-viewer-modal {
    z-index: 5000 !important;
}

#text-input-modal .modal-content,
#icon-selector-modal .modal-content,
#image-picker-modal .modal-content,
#group-selection-modal .modal-content,
#image-management-modal .modal-content,
#image-viewer-modal .modal-content {
    z-index: 5001 !important;
}

/* 标注信息项样式优化 */
.location-info-item {
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.location-info-item.empty {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.info-label {
    font-weight: 600;
    color: #333;
    min-width: 80px;
    font-size: 14px;
}

.info-value {
    color: #666;
    flex: 1;
    text-align: right;
    font-size: 14px;
    padding: 0 8px;
}

.empty-text {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* 图片预览样式优化 */
.images-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.image-item {
    padding: 4px 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

/* 操作按钮组优化 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.cancel-btn, .confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    max-width: 200px;
}

.cancel-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.confirm-btn {
    background: #4CAF50;
    color: white;
}

.cancel-btn:active {
    background: #e9ecef;
}

.confirm-btn:active {
    background: #45a049;
}

/* 标注操作按钮优化 */
.mark-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.mark-action-buttons .action-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.mark-action-buttons .primary {
    background: #2196F3;
    border-color: #2196F3;
    color: white;
}

.mark-action-buttons .primary:active {
    background: #1976D2;
}

/* 确保表格布局正确 */
.management-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.table-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    flex-shrink: 0;
}

.table-body {
    flex: 1;
    overflow-y: auto;
    max-height: 40vh;
}

.table-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    min-height: 60px;
}

.table-cell {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 列宽分配 */
.table-header .table-cell:nth-child(1),
.table-row .table-cell:nth-child(1) {
    width: 20%; /* 序号 */
}

.table-header .table-cell:nth-child(2),
.table-row .table-cell:nth-child(2) {
    width: 50%; /* 内容 */
}

.table-header .table-cell:nth-child(3),
.table-row .table-cell:nth-child(3) {
    width: 30%; /* 操作 */
}

/* 操作按钮样式 */
.action-btn {
    padding: 6px 12px;
    border: 1px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 6px;
    font-size: 12px;
    margin: 0 2px;
    min-width: 50px;
}

.action-btn:active {
    background: #4CAF50;
    color: white;
}

.delete-btn {
    border-color: #f44336;
    color: #f44336;
}

.delete-btn:active {
    background: #f44336;
    color: white;
}
/* 用户信息区域样式 */
.user-info {
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.9;
}

.user-avatar {
    transition: transform 0.3s ease;
}

.user-info:hover .user-avatar {
    transform: scale(1.1);
}

/* 退出按钮样式 */
#logout-btn {
    transition: all 0.3s ease;
    color: white;
    font-size: 16px;
}

#logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 管理后台按钮样式 */
#admin-btn {
    background: none;
    color: white;
    font-size: 20px;
}

#admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .user-details {
        display: none !important; /* 手机端隐藏详细用户信息 */
    }
    
    .user-info {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-avatar {
        font-size: 20px !important;
    }
    
    #admin-btn,
    #settings-btn,
    #logout-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .app-title {
        font-size: 16px;
        margin: 0 10px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .location-levels {
        gap: 10px;
    }
    
    .location-select {
        padding: 12px;
        font-size: 16px; /* 移动端加大字体 */
    }
    
    .selected-location {
        padding: 12px;
    }
}

/* ============ 图标选择器样式（5大分类） ============ */

.icon-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

.category-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-type {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-item:hover {
    border-color: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.icon-item.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.icon-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
    padding: 4px;
}

.icon-number {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
}

.icon-meaning {
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 已选图标展示区域 */
.selected-icons-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
    margin-top: 15px;
}

.selected-icon-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #4CAF50;
    border-radius: 20px;
    font-size: 12px;
}

.selected-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.remove-icon-btn {
    background: none;
    border: none;
    color: #f44336;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .icon-item {
        padding: 8px;
    }
    
    .icon-image {
        width: 35px;
        height: 35px;
    }
    
    .selected-icons-display {
        padding: 12px;
        gap: 8px;
    }
    
    .selected-icon-pill {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ============ 标注表单新样式 ============ */

.mark-form-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.section-subtitle {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.edit-section-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.edit-section-btn:hover {
    background: #45a049;
}

.section-content {
    min-height: 40px;
    display: flex;
    align-items: center;
}

.empty-section {
    color: #999;
    font-style: italic;
    font-size: 14px;
    padding: 10px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 6px;
    width: 100%;
}

/* 多选图标展示 */
.multi-icons-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    padding: 2px;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.form-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.3s ease;
}

.cancel-form-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.cancel-form-btn:hover {
    background: #e9ecef;
}

.save-form-btn {
    background: #4CAF50;
    color: white;
}

.save-form-btn:hover {
    background: #45a049;
}

.save-form-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}


/* 移动端适配 */
@media (max-width: 768px) {
    .icons-grid-single-series {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
    }
    
    .icon-item-single {
        padding: 12px;
    }
    
    .icon-image-single {
        width: 40px;
        height: 40px;
    }
    
    .icon-meaning-single {
        font-size: 12px;
    }
}


/* 地点备注输入框 */
.notes-input-container {
    width: 100%;
}

.notes-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.notes-textarea::placeholder {
    color: #999;
}

