/* 商品追蹤相關樣式 */
.item-actions {
    margin-top: 10px;
}

.btn-track {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.25);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    min-width: 140px;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.btn-track:hover::before {
    left: 100%;
}

.btn-track:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.35);
    background: linear-gradient(135deg, #ff5252, #ff7979);
}

.btn-track:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.1s ease;
}

.btn-track.tracked {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
}

.btn-track.tracked::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.btn-track.tracked:hover {
    background: linear-gradient(135deg, #43A047, #5CB85C);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.35);
    transform: translateY(-3px) scale(1.02);
}

.btn-track.tracked .heart-icon {
    color: white;
    animation: heartBeat 2s ease-in-out infinite;
}

.heart-icon {
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-block;
    line-height: 1;
}

/* 心跳動畫 */
@keyframes heartBeat {
    0%, 50%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    75% {
        transform: scale(1.05);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .btn-track {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 120px;
    }
}

/* 按鈕載入狀態 */
.btn-track.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-track.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 12px;
}

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

.btn-track.tracked .heart-icon:before {
    content: "♥";
}

/* 追蹤通知樣式 - 修復收回動畫 */
.tracking-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    z-index: 1000;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    will-change: transform, opacity;
}

.tracking-notification::before {
    content: '✓';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: bold;
}

.tracking-notification.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    animation: slideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tracking-notification.hide {
    transform: translateX(100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.tracking-notification.error {
    background: linear-gradient(135deg, #f44336, #ef5350);
    box-shadow: 0 8px 32px rgba(244, 67, 54, 0.3);
}

.tracking-notification.error::before {
    content: '✗';
}

@keyframes slideInBounce {
    0% {
        transform: translateX(100%);
    }
    70% {
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0);
    }
}

/* 追蹤選項彈窗樣式 */
.tracking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.tracking-modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tracking-modal h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.tracking-options {
    margin-bottom: 24px;
}

.tracking-option {
    display: block;
    margin-bottom: 16px;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.tracking-option:hover {
    border-color: #ff6b6b;
    background-color: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.tracking-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.tracking-option input[type="radio"]:checked + .tracking-option-label {
    color: #ff6b6b;
}

.tracking-option input[type="radio"]:checked + .tracking-option-label::before {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.tracking-option input[type="radio"]:checked + .tracking-option-label::after {
    opacity: 1;
    transform: scale(1);
}

.tracking-option-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding-left: 32px;
    transition: color 0.3s ease;
}

.tracking-option-label::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.tracking-option-label::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: all 0.3s ease;
}

.tracking-option-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.tracking-option-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.notification-email-group,
.price-threshold-group {
    margin-bottom: 24px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.notification-email-group.show,
.price-threshold-group.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.notification-email-group label,
.price-threshold-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.notification-email-group input,
.price-threshold-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.notification-email-group input:focus,
.price-threshold-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    background: #fff5f5;
}

.tracking-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
}

.tracking-modal-actions .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.tracking-modal-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.tracking-modal-actions .btn-secondary:hover {
    background: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.tracking-modal-actions .btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.tracking-modal-actions .btn-primary:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.tracking-modal-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .tracking-modal-content {
        margin: 20px;
        padding: 20px;
    }
    
    .btn-track {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 120px;
    }
    
    .tracking-modal-actions {
        flex-direction: column;
    }
    
    .tracking-modal-actions .btn {
        width: 100%;
    }
}
