/**
 * 更新的前端CSS样式 - 替换 assets/css/frontend.css 的内容
 * 
 * @package WooJerseyCustomizer
 * @author xunlu
 * @version 1.0.5
 */

/* 基础重置 */
.wjc-customization-section * {
    box-sizing: border-box;
}

/* 主容器 */
.wjc-customization-section {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* 标题区域 */
.wjc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
}

.wjc-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
    letter-spacing: 0.5px;
}

.wjc-more-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.wjc-more-link:hover {
    color: #333;
    text-decoration: underline;
}

.wjc-arrow {
    font-size: 12px;
    font-weight: bold;
}

/* 单选按钮组 */
.wjc-radio-group {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.wjc-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    color: #666;
    transition: color 0.2s ease;
}

.wjc-radio-option:hover {
    color: #333;
}

.wjc-radio-option input[type="radio"] {
    display: none;
}

.wjc-radio-dot {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wjc-radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wjc-radio-option input[type="radio"]:checked + .wjc-radio-dot {
    border-color: #333;
}

.wjc-radio-option input[type="radio"]:checked + .wjc-radio-dot::after {
    opacity: 1;
}

.wjc-radio-option input[type="radio"]:checked ~ .wjc-radio-label {
    color: #333;
    font-weight: 500;
}

/* 下拉选择器公共样式 */
.wjc-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 44px;
}

.wjc-dropdown-trigger:hover {
    border-color: #999;
}

.wjc-dropdown-trigger.active {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.wjc-dropdown-text {
    font-size: 14px;
    color: #333;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.wjc-dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.wjc-dropdown-trigger.active .wjc-dropdown-arrow {
    transform: rotate(180deg);
}

.wjc-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.wjc-dropdown-menu.show {
    display: block;
}

.wjc-dropdown-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.wjc-dropdown-item:last-child {
    border-bottom: none;
}

.wjc-dropdown-item:hover {
    background-color: #f8f9fa;
}

.wjc-dropdown-item.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 球员选择器 */
.wjc-player-section {
    margin-bottom: 16px;
}

.wjc-player-selector {
    position: relative;
}

/* 自定义输入区域 */
.wjc-custom-section {
    margin-bottom: 16px;
}

.wjc-custom-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wjc-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: white;
    transition: all 0.2s ease;
    min-height: 44px;
}

.wjc-input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.wjc-input:hover {
    border-color: #999;
}

.wjc-input::placeholder {
    color: #999;
}

/* 补丁选择器 */
.wjc-patches-section {
    margin-bottom: 16px;
}

.wjc-patch-selector {
    position: relative;
}

.wjc-patch-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.wjc-patch-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

.wjc-patch-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f8f8;
}

.wjc-patch-item .wjc-patch-content {
    width: 100%;
}

.wjc-patch-text {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 已选择的补丁 */
.wjc-selected-patches {
    margin-bottom: 12px;
}

.wjc-selected-patch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.wjc-selected-patch:hover {
    background: #e9ecef;
}

.wjc-selected-patch-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.wjc-selected-patch-text {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wjc-remove-patch {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: white;
}

.wjc-remove-patch:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: white;
}

/* 错误消息 */
.wjc-error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 6px;
    color: #c62828;
    margin-bottom: 16px;
    animation: wjc-shake 0.5s ease-in-out;
}

@keyframes wjc-shake {
    0%, 20%, 40%, 60%, 80% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
}

.wjc-error-icon {
    font-size: 16px;
    color: #f44336;
    flex-shrink: 0;
}

.wjc-error-text {
    font-size: 14px;
    font-weight: 500;
}

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

.wjc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: wjc-spin 1s linear infinite;
}

@keyframes wjc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wjc-customization-section {
        margin: 16px 0;
    }
    
    .wjc-radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .wjc-custom-inputs {
        grid-template-columns: 1fr;
    }
    
    .wjc-dropdown-trigger {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        min-height: auto;
    }
    
    .wjc-dropdown-arrow {
        align-self: flex-end;
        margin-top: -16px;
    }
    
    .wjc-patch-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .wjc-selected-patch-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .wjc-dropdown-text {
        margin-right: 0;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .wjc-title {
        font-size: 14px;
    }
    
    .wjc-more-link {
        font-size: 12px;
    }
    
    .wjc-dropdown-trigger {
        padding: 10px 12px;
    }
    
    .wjc-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .wjc-dropdown-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .wjc-selected-patch {
        padding: 6px 10px;
    }
    
    .wjc-selected-patch-text {
        font-size: 13px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .wjc-dropdown-trigger,
    .wjc-input {
        border-width: 2px;
    }
    
    .wjc-radio-dot {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .wjc-customization-section {
        border: 1px solid #000;
        box-shadow: none;
        background: white;
    }
    
    .wjc-dropdown-menu {
        display: none !important;
    }
    
    .wjc-remove-patch {
        display: none;
    }
}