/* Target Selector Editor 样式 */

/* 主容器和布局 */
.tool-container {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 装饰元素 */
.grass-block-decoration,
.diamond-ore-decoration {
    position: absolute;
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

.grass-block-decoration {
    top: -20px;
    right: -20px;
    background-image: url('/images/minecraft/grass_block.png');
    transform: rotate(15deg);
}

.diamond-ore-decoration {
    bottom: -20px;
    left: -20px;
    background-image: url('/images/minecraft/diamond_ore.png');
    transform: rotate(-15deg);
}

/* 选择器类型选择区域 */
.selector-type-section {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}

.selector-type-section h2 {
    color: #fff;
    font-family: 'Minecraft', Arial, sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.section-subtitle {
    color: #b3d9ff;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.selector-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.selector-type-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.selector-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: #4CAF50;
}

.selector-type-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    transform: translateY(-3px);
}

.selector-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    color: white;
    font-weight: bold;
}

.selector-type-card h3 {
    font-family: 'Minecraft', Arial, sans-serif;
    font-size: 1.3rem;
    color: #333;
    margin: 0.5rem 0;
}

.selector-type-card h4 {
    font-size: 1rem;
    color: #666;
    margin: 0.25rem 0;
    font-weight: 600;
}

.selector-type-card p {
    color: #777;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.select-type-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Minecraft', Arial, sans-serif;
}

.select-type-btn:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: scale(1.05);
}

/* 参数配置区域 */
.parameter-config-section {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}

.current-selector-display {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.current-selector-display h3 {
    color: #333;
    margin-bottom: 1rem;
    font-family: 'Minecraft', Arial, sans-serif;
}

.selector-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#selector-output {
    background: #2d3748;
    color: #4ade80;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    min-width: 200px;
    text-align: left;
    border: 2px solid #4ade80;
}

.copy-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #10b981;
}

/* 参数分类 */
.parameter-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.parameter-category {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Minecraft', Arial, sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.category-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.category-icon {
    font-size: 1.3rem;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.parameter-category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category-content {
    padding: 1.5rem;
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.parameter-category.collapsed .category-content {
    max-height: 0;
    padding: 0 1.5rem;
}

.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.parameter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parameter-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.parameter-item input,
.parameter-item select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.parameter-item input:focus,
.parameter-item select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.parameter-item small {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* 预览区域 */
.preview-section {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}

.preview-container {
    display: grid;
    gap: 2rem;
}

.selector-examples {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
}

.selector-examples h3 {
    color: #333;
    margin-bottom: 1rem;
    font-family: 'Minecraft', Arial, sans-serif;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.example-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.example-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.example-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.example-card code {
    background: #2d3748;
    color: #4ade80;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.example-card p {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.validation-status {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
}

.validation-status h3 {
    color: #333;
    margin-bottom: 1rem;
    font-family: 'Minecraft', Arial, sans-serif;
}

.validation-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 2px solid #10b981;
    border-radius: 8px;
}

.validation-display.error {
    background: #fef2f2;
    border-color: #ef4444;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 600;
    color: #10b981;
}

.validation-display.error .status-text {
    color: #ef4444;
}

/* 使用指南 */
.usage-guide {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 2rem;
}

.usage-guide h2 {
    color: #333;
    font-family: 'Minecraft', Arial, sans-serif;
    margin-bottom: 1.5rem;
}

.guide-sections {
    display: grid;
    gap: 2rem;
}

.guide-section {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f8fafc;
}

.guide-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-family: 'Minecraft', Arial, sans-serif;
    font-size: 1.2rem;
}

.guide-section p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.guide-section ul {
    list-style: none;
    padding: 0;
}

.guide-section li {
    color: #666;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.guide-section li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

.guide-section code {
    background: #2d3748;
    color: #4ade80;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.selector-explanations {
    display: grid;
    gap: 1rem;
}

.explanation-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    color: #666;
    line-height: 1.5;
}

.explanation-item strong {
    color: #333;
    font-family: 'Courier New', monospace;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .selector-types-grid {
        grid-template-columns: 1fr;
    }
    
    .parameter-grid {
        grid-template-columns: 1fr;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
    
    .selector-preview {
        flex-direction: column;
        align-items: stretch;
    }
    
    #selector-output {
        text-align: center;
        min-width: auto;
    }
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.parameter-config-section,
.preview-section {
    animation: slideIn 0.5s ease-out;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
