/* 增強版選擇按鈕視覺反饋樣式 */

.option-card {
    position: relative;
    padding: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.1) 0%, 
        rgba(231, 76, 60, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.option-card:hover::before {
    opacity: 1;
}

.option-card:hover {
    border-color: rgba(196, 30, 58, 0.6);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.12) 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        0 0 25px rgba(196, 30, 58, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 選中狀態 - 增強可見性 */
.option-card.selected {
    border-color: var(--color-primary-red);
    border-width: 4px;
    background: linear-gradient(135deg, 
        rgba(196, 30, 58, 0.4) 0%, 
        rgba(231, 76, 60, 0.25) 100%);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(196, 30, 58, 0.7),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 0 20px rgba(196, 30, 58, 0.2);
    transform: translateY(-3px) scale(1.05);
    animation: selected-glow 2s ease-in-out infinite alternate;
}

@keyframes selected-glow {
    0% { 
        box-shadow: 
            0 8px 30px rgba(0, 0, 0, 0.3),
            0 0 40px rgba(196, 30, 58, 0.7),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
    }
    100% { 
        box-shadow: 
            0 12px 40px rgba(0, 0, 0, 0.4),
            0 0 60px rgba(196, 30, 58, 0.9),
            inset 0 2px 0 rgba(255, 255, 255, 0.5);
    }
}

.option-card.selected::before {
    opacity: 1;
}

.option-card.selected::after {
    content: '✓ 已選';
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--color-primary-red) 0%, #e74c3c 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: checkmark-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 4px 15px rgba(196, 30, 58, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 選中狀態的文字高亮 */
.option-card.selected .option-text {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.option-card.selected .option-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px rgba(196, 30, 58, 0.8));
}

@keyframes checkmark-bounce {
    0% { 
        transform: scale(0) rotate(-180deg); 
        opacity: 0;
    }
    50% { 
        transform: scale(1.3) rotate(-90deg); 
        opacity: 0.8;
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1;
    }
}

.option-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.option-card:hover .option-icon {
    transform: scale(1.1);
}

.option-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 網格佈局 */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* 計數器樣式 */
.selection-counter {
    text-align: center;
    color: var(--color-white);
    font-size: 15px;
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.selection-counter span {
    color: var(--color-primary-red);
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 配置區域 */
.config-section {
    margin-bottom: 45px;
}

.config-section h3 {
    color: var(--color-white);
    font-size: 22px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* 進度指示器 */
.selection-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--color-primary-red);
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.5);
    transform: scale(1.2);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .option-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .option-card {
        padding: 16px;
    }
    
    .option-icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .config-section h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .option-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .option-card {
        padding: 14px;
    }
    
    .option-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .option-text {
        font-size: 13px;
    }
    
    .selection-counter {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .config-section h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
}

/* 錯誤狀態 */
.option-card.error {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, 
        rgba(255, 107, 107, 0.2) 0%, 
        rgba(255, 107, 107, 0.1) 100%);
    animation: shake 0.6s ease-in-out;
}

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

/* 禁用狀態 */
.option-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(50%);
}

/* 載入狀態 */
.option-card.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.option-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid transparent;
    border-top: 3px solid var(--color-primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* 脈衝效果 */
.option-card.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(196, 30, 58, 0); }
    100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0); }
}

/* 特殊效果：閃爍邊框 */
.option-card.highlight {
    animation: highlight-border 1.5s ease-in-out infinite;
}

@keyframes highlight-border {
    0%, 100% { border-color: rgba(255, 255, 255, 0.3); }
    50% { border-color: var(--color-primary-red); }
}

/* 工具提示樣式 */
.option-card[data-tooltip] {
    position: relative;
}

.option-card[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: tooltip-fade-in 0.3s ease forwards;
}

@keyframes tooltip-fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
